From be7cf878db53c3adfcd379f56a4b9f28275cdb19 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Tue, 31 Oct 2023 13:48:00 +0100 Subject: [PATCH] Serverless (#7966) --- Elasticsearch.sln | 23 + release.bat | 1 + .../Client/ElasticsearchClient.cs | 334 ++ .../ElasticsearchClientProductRegistration.cs | 43 + ...ic.Clients.Elasticsearch.Serverless.csproj | 44 + .../_Generated/Api/ApiUrlLookup.g.cs | 110 + .../AsyncSearch/AsyncSearchStatusRequest.g.cs | 120 + .../AsyncSearchStatusResponse.g.cs | 66 + .../AsyncSearch/DeleteAsyncSearchRequest.g.cs | 120 + .../DeleteAsyncSearchResponse.g.cs | 35 + .../AsyncSearch/GetAsyncSearchRequest.g.cs | 160 + .../AsyncSearch/GetAsyncSearchResponse.g.cs | 51 + .../AsyncSearch/SubmitAsyncSearchRequest.g.cs | 3088 ++++++++++++++ .../SubmitAsyncSearchResponse.g.cs | 51 + .../_Generated/Api/BulkRequest.g.cs | 234 + .../_Generated/Api/BulkResponse.g.cs | 36 + .../_Generated/Api/ClearScrollRequest.g.cs | 91 + .../_Generated/Api/ClearScrollResponse.g.cs | 34 + .../Api/ClosePointInTimeRequest.g.cs | 87 + .../Api/ClosePointInTimeResponse.g.cs | 34 + .../Api/Cluster/AllocationExplainRequest.g.cs | 187 + .../Cluster/AllocationExplainResponse.g.cs | 80 + .../Api/Cluster/ClusterStatsRequest.g.cs | 110 + .../Api/Cluster/ClusterStatsResponse.g.cs | 67 + .../Cluster/GetClusterSettingsRequest.g.cs | 120 + .../Cluster/GetClusterSettingsResponse.g.cs | 36 + .../_Generated/Api/Cluster/HealthRequest.g.cs | 260 ++ .../Api/Cluster/HealthResponse.g.cs | 124 + .../Api/Cluster/PendingTasksRequest.g.cs | 96 + .../Api/Cluster/PendingTasksResponse.g.cs | 32 + .../_Generated/Api/CountRequest.g.cs | 401 ++ .../_Generated/Api/CountResponse.g.cs | 34 + .../_Generated/Api/CreateRequest.g.cs | 193 + .../_Generated/Api/CreateResponse.g.cs | 46 + .../_Generated/Api/DeleteByQueryRequest.g.cs | 695 +++ .../_Generated/Api/DeleteByQueryResponse.g.cs | 62 + .../_Generated/Api/DeleteRequest.g.cs | 257 ++ .../_Generated/Api/DeleteResponse.g.cs | 46 + .../_Generated/Api/DeleteScriptRequest.g.cs | 147 + .../_Generated/Api/DeleteScriptResponse.g.cs | 35 + .../Api/Enrich/DeletePolicyRequest.g.cs | 86 + .../Api/Enrich/DeletePolicyResponse.g.cs | 35 + .../Api/Enrich/EnrichStatsRequest.g.cs | 72 + .../Api/Enrich/EnrichStatsResponse.g.cs | 47 + .../Api/Enrich/ExecutePolicyRequest.g.cs | 98 + .../Api/Enrich/ExecutePolicyResponse.g.cs | 34 + .../Api/Enrich/GetPolicyRequest.g.cs | 86 + .../Api/Enrich/GetPolicyResponse.g.cs | 32 + .../Api/Enrich/PutPolicyRequest.g.cs | 420 ++ .../Api/Enrich/PutPolicyResponse.g.cs | 35 + .../_Generated/Api/ExistsRequest.g.cs | 283 ++ .../_Generated/Api/ExistsResponse.g.cs | 34 + .../_Generated/Api/ExistsSourceRequest.g.cs | 270 ++ .../_Generated/Api/ExistsSourceResponse.g.cs | 34 + .../_Generated/Api/FieldCapsRequest.g.cs | 375 ++ .../_Generated/Api/FieldCapsResponse.g.cs | 35 + .../_Generated/Api/GetRequest.g.cs | 283 ++ .../_Generated/Api/GetResponse.g.cs | 49 + .../_Generated/Api/GetScriptRequest.g.cs | 134 + .../_Generated/Api/GetScriptResponse.g.cs | 36 + .../_Generated/Api/GetSourceRequest.g.cs | 275 ++ .../_Generated/Api/GetSourceResponse.g.cs | 30 + .../_Generated/Api/Graph/ExploreRequest.g.cs | 601 +++ .../_Generated/Api/Graph/ExploreResponse.g.cs | 40 + .../IndexManagement/CloseIndexRequest.g.cs | 199 + .../IndexManagement/CloseIndexResponse.g.cs | 37 + .../CreateDataStreamRequest.g.cs | 86 + .../CreateDataStreamResponse.g.cs | 35 + .../IndexManagement/CreateIndexRequest.g.cs | 404 ++ .../IndexManagement/CreateIndexResponse.g.cs | 36 + .../IndexManagement/DeleteAliasRequest.g.cs | 159 + .../IndexManagement/DeleteAliasResponse.g.cs | 35 + .../DeleteDataLifecycleRequest.g.cs | 124 + .../DeleteDataLifecycleResponse.g.cs | 38 + .../DeleteDataStreamRequest.g.cs | 98 + .../DeleteDataStreamResponse.g.cs | 35 + .../IndexManagement/DeleteIndexRequest.g.cs | 186 + .../IndexManagement/DeleteIndexResponse.g.cs | 34 + .../DeleteIndexTemplateRequest.g.cs | 110 + .../DeleteIndexTemplateResponse.g.cs | 35 + .../DeleteTemplateRequest.g.cs | 110 + .../DeleteTemplateResponse.g.cs | 35 + .../IndexManagement/ExistsAliasRequest.g.cs | 197 + .../IndexManagement/ExistsAliasResponse.g.cs | 34 + .../ExistsIndexTemplateRequest.g.cs | 98 + .../ExistsIndexTemplateResponse.g.cs | 34 + .../Api/IndexManagement/ExistsRequest.g.cs | 199 + .../Api/IndexManagement/ExistsResponse.g.cs | 34 + .../ExistsTemplateRequest.g.cs | 122 + .../ExistsTemplateResponse.g.cs | 34 + .../ExplainDataLifecycleRequest.g.cs | 150 + .../ExplainDataLifecycleResponse.g.cs | 36 + .../Api/IndexManagement/GetAliasRequest.g.cs | 205 + .../Api/IndexManagement/GetAliasResponse.g.cs | 37 + .../GetDataLifecycleRequest.g.cs | 112 + .../GetDataLifecycleResponse.g.cs | 35 + .../IndexManagement/GetDataStreamRequest.g.cs | 110 + .../GetDataStreamResponse.g.cs | 32 + .../Api/IndexManagement/GetIndexRequest.g.cs | 225 + .../Api/IndexManagement/GetIndexResponse.g.cs | 37 + .../GetIndexTemplateRequest.g.cs | 134 + .../GetIndexTemplateResponse.g.cs | 32 + .../IndexManagement/GetMappingRequest.g.cs | 182 + .../IndexManagement/GetMappingResponse.g.cs | 37 + .../IndexManagement/GetTemplateRequest.g.cs | 122 + .../IndexManagement/GetTemplateResponse.g.cs | 37 + .../IndexManagement/IndicesStatsRequest.g.cs | 270 ++ .../IndexManagement/IndicesStatsResponse.g.cs | 36 + .../MigrateToDataStreamRequest.g.cs | 86 + .../MigrateToDataStreamResponse.g.cs | 35 + .../Api/IndexManagement/OpenIndexRequest.g.cs | 199 + .../IndexManagement/OpenIndexResponse.g.cs | 34 + .../Api/IndexManagement/PutAliasRequest.g.cs | 415 ++ .../Api/IndexManagement/PutAliasResponse.g.cs | 35 + .../PutDataLifecycleRequest.g.cs | 149 + .../PutDataLifecycleResponse.g.cs | 38 + .../PutIndexTemplateRequest.g.cs | 526 +++ .../PutIndexTemplateResponse.g.cs | 35 + .../IndexManagement/PutMappingRequest.g.cs | 850 ++++ .../IndexManagement/PutMappingResponse.g.cs | 34 + .../IndexManagement/PutTemplateRequest.g.cs | 301 ++ .../IndexManagement/PutTemplateResponse.g.cs | 35 + .../Api/IndexManagement/RolloverRequest.g.cs | 299 ++ .../Api/IndexManagement/RolloverResponse.g.cs | 44 + .../SimulateIndexTemplateRequest.g.cs | 581 +++ .../SimulateIndexTemplateResponse.g.cs | 30 + .../SimulateTemplateRequest.g.cs | 122 + .../SimulateTemplateResponse.g.cs | 34 + .../IndexManagement/UpdateAliasesRequest.g.cs | 283 ++ .../UpdateAliasesResponse.g.cs | 35 + .../_Generated/Api/IndexRequest.g.cs | 247 ++ .../_Generated/Api/IndexResponse.g.cs | 46 + .../_Generated/Api/InfoRequest.g.cs | 72 + .../_Generated/Api/InfoResponse.g.cs | 40 + .../Api/Ingest/DeletePipelineRequest.g.cs | 147 + .../Api/Ingest/DeletePipelineResponse.g.cs | 35 + .../Api/Ingest/GeoIpStatsRequest.g.cs | 72 + .../Api/Ingest/GeoIpStatsResponse.g.cs | 41 + .../Api/Ingest/GetPipelineRequest.g.cs | 143 + .../Api/Ingest/GetPipelineResponse.g.cs | 37 + .../Api/Ingest/ProcessorGrokRequest.g.cs | 72 + .../Api/Ingest/ProcessorGrokResponse.g.cs | 32 + .../Api/Ingest/PutPipelineRequest.g.cs | 588 +++ .../Api/Ingest/PutPipelineResponse.g.cs | 35 + .../Api/Ingest/SimulateRequest.g.cs | 388 ++ .../Api/Ingest/SimulateResponse.g.cs | 32 + .../_Generated/Api/MultiGetRequest.g.cs | 419 ++ .../_Generated/Api/MultiGetResponse.g.cs | 32 + .../_Generated/Api/MultiSearchRequest.g.cs | 358 ++ .../_Generated/Api/MultiSearchResponse.g.cs | 34 + .../Api/MultiSearchTemplateRequest.g.cs | 267 ++ .../Api/MultiSearchTemplateResponse.g.cs | 34 + .../Api/MultiTermVectorsRequest.g.cs | 438 ++ .../Api/MultiTermVectorsResponse.g.cs | 32 + .../Api/OpenPointInTimeRequest.g.cs | 186 + .../Api/OpenPointInTimeResponse.g.cs | 32 + .../_Generated/Api/PingRequest.g.cs | 72 + .../_Generated/Api/PingResponse.g.cs | 30 + .../_Generated/Api/PutScriptRequest.g.cs | 265 ++ .../_Generated/Api/PutScriptResponse.g.cs | 35 + .../_Generated/Api/RankEvalRequest.g.cs | 427 ++ .../_Generated/Api/RankEvalResponse.g.cs | 43 + .../Api/RenderSearchTemplateRequest.g.cs | 207 + .../Api/RenderSearchTemplateResponse.g.cs | 32 + .../_Generated/Api/ScrollRequest.g.cs | 127 + .../_Generated/Api/ScrollResponse.g.cs | 58 + .../_Generated/Api/SearchRequest.g.cs | 3301 +++++++++++++++ .../_Generated/Api/SearchResponse.g.cs | 58 + .../_Generated/Api/SearchTemplateRequest.g.cs | 426 ++ .../Api/SearchTemplateResponse.g.cs | 58 + .../_Generated/Api/TermVectorsRequest.g.cs | 323 ++ .../_Generated/Api/TermVectorsResponse.g.cs | 43 + .../_Generated/Api/TermsEnumRequest.g.cs | 465 ++ .../_Generated/Api/TermsEnumResponse.g.cs | 36 + .../_Generated/Api/UpdateByQueryRequest.g.cs | 751 ++++ .../_Generated/Api/UpdateByQueryResponse.g.cs | 62 + .../_Generated/Api/UpdateRequest.g.cs | 403 ++ .../_Generated/Api/UpdateResponse.g.cs | 48 + .../ElasticsearchClient.AsyncSearch.g.cs | 470 ++ .../Client/ElasticsearchClient.Cluster.g.cs | 512 +++ .../Client/ElasticsearchClient.Enrich.g.cs | 490 +++ .../Client/ElasticsearchClient.Graph.g.cs | 168 + .../Client/ElasticsearchClient.Indices.g.cs | 3618 ++++++++++++++++ .../Client/ElasticsearchClient.Ingest.g.cs | 708 ++++ .../Client/ElasticsearchClient.g.cs | 3771 +++++++++++++++++ .../Types/AggregateOrderConverter.g.cs | 35 + .../AdjacencyMatrixAggregate.g.cs | 36 + .../AdjacencyMatrixAggregation.g.cs | 317 ++ .../Aggregations/AdjacencyMatrixBucket.g.cs | 85 + .../Aggregations/AggregateDictionary.g.cs | 99 + .../Types/Aggregations/Aggregation.g.cs | 1221 ++++++ .../Types/Aggregations/AggregationRange.g.cs | 113 + .../Aggregations/ArrayPercentilesItem.g.cs | 38 + .../AutoDateHistogramAggregate.g.cs | 38 + .../AutoDateHistogramAggregation.g.cs | 764 ++++ .../Types/Aggregations/AverageAggregate.g.cs | 38 + .../Aggregations/AverageAggregation.g.cs | 357 ++ .../Types/Aggregations/BoxplotAggregate.g.cs | 62 + .../Aggregations/BoxplotAggregation.g.cs | 366 ++ .../Aggregations/BucketSortAggregation.g.cs | 489 +++ .../Types/Aggregations/Buckets.g.cs | 42 + .../Types/Aggregations/BucketsPath.g.cs | 123 + .../Aggregations/CardinalityAggregate.g.cs | 36 + .../Aggregations/CardinalityAggregation.g.cs | 466 ++ .../Aggregations/ChiSquareHeuristic.g.cs | 83 + .../Types/Aggregations/ChildrenAggregate.g.cs | 85 + .../Aggregations/ChildrenAggregation.g.cs | 317 ++ .../Aggregations/CompositeAggregate.g.cs | 38 + .../Aggregations/CompositeAggregation.g.cs | 426 ++ .../CompositeAggregationSource.g.cs | 45 + .../Types/Aggregations/CompositeBucket.g.cs | 85 + .../CumulativeCardinalityAggregate.g.cs | 41 + .../CumulativeCardinalityAggregation.g.cs | 222 + .../CumulativeSumAggregation.g.cs | 222 + .../Aggregations/DateHistogramAggregate.g.cs | 36 + .../DateHistogramAggregation.g.cs | 874 ++++ .../Aggregations/DateHistogramBucket.g.cs | 94 + .../Aggregations/DateRangeAggregate.g.cs | 39 + .../Aggregations/DateRangeAggregation.g.cs | 680 +++ .../Aggregations/DateRangeExpression.g.cs | 113 + .../Aggregations/DerivativeAggregate.g.cs | 42 + .../Aggregations/DerivativeAggregation.g.cs | 222 + .../DiversifiedSamplerAggregation.g.cs | 554 +++ .../Aggregations/DoubleTermsAggregate.g.cs | 43 + .../Types/Aggregations/DoubleTermsBucket.g.cs | 103 + .../Aggregations/ExtendedStatsAggregate.g.cs | 80 + .../ExtendedStatsAggregation.g.cs | 412 ++ .../ExtendedStatsBucketAggregate.g.cs | 80 + .../ExtendedStatsBucketAggregation.g.cs | 261 ++ .../Types/Aggregations/FieldDateMath.g.cs | 42 + .../Types/Aggregations/FilterAggregate.g.cs | 85 + .../Types/Aggregations/FiltersAggregate.g.cs | 36 + .../Aggregations/FiltersAggregation.g.cs | 427 ++ .../Types/Aggregations/FiltersBucket.g.cs | 76 + .../Aggregations/GeoBoundsAggregate.g.cs | 36 + .../Aggregations/GeoBoundsAggregation.g.cs | 367 ++ .../Aggregations/GeoCentroidAggregate.g.cs | 38 + .../Aggregations/GeoCentroidAggregation.g.cs | 402 ++ .../Aggregations/GeoDistanceAggregate.g.cs | 39 + .../Aggregations/GeoDistanceAggregation.g.cs | 680 +++ .../Types/Aggregations/GeoLineAggregate.g.cs | 40 + .../Aggregations/GeoLineAggregation.g.cs | 536 +++ .../Types/Aggregations/GeoLinePoint.g.cs | 120 + .../Types/Aggregations/GeoLineSort.g.cs | 120 + .../Aggregations/GeohashGridAggregate.g.cs | 36 + .../Aggregations/GeohashGridAggregation.g.cs | 564 +++ .../Types/Aggregations/GeohashGridBucket.g.cs | 85 + .../Aggregations/GeohexGridAggregate.g.cs | 36 + .../Aggregations/GeohexGridAggregation.g.cs | 548 +++ .../Types/Aggregations/GeohexGridBucket.g.cs | 85 + .../Aggregations/GeotileGridAggregate.g.cs | 36 + .../Aggregations/GeotileGridAggregation.g.cs | 564 +++ .../Types/Aggregations/GeotileGridBucket.g.cs | 85 + .../Types/Aggregations/GlobalAggregate.g.cs | 85 + .../Types/Aggregations/GlobalAggregation.g.cs | 263 ++ .../GoogleNormalizedDistanceHeuristic.g.cs | 69 + .../Types/Aggregations/HdrMethod.g.cs | 69 + .../Aggregations/HistogramAggregate.g.cs | 36 + .../Aggregations/HistogramAggregation.g.cs | 709 ++++ .../Types/Aggregations/HistogramBucket.g.cs | 94 + .../Aggregations/InferenceAggregate.g.cs | 44 + .../Aggregations/InferenceAggregation.g.cs | 447 ++ .../InferenceClassImportance.g.cs | 36 + .../Types/Aggregations/InferenceConfig.g.cs | 222 + .../InferenceFeatureImportance.g.cs | 38 + .../Aggregations/InferenceTopClassEntry.g.cs | 38 + .../Types/Aggregations/IpPrefixAggregate.g.cs | 36 + .../Aggregations/IpPrefixAggregation.g.cs | 587 +++ .../Types/Aggregations/IpPrefixBucket.g.cs | 112 + .../Types/Aggregations/IpRangeAggregate.g.cs | 36 + .../Aggregations/IpRangeAggregation.g.cs | 515 +++ .../Aggregations/IpRangeAggregationRange.g.cs | 113 + .../Types/Aggregations/IpRangeBucket.g.cs | 103 + .../Aggregations/LongTermsAggregate.g.cs | 43 + .../Types/Aggregations/LongTermsBucket.g.cs | 103 + .../Aggregations/MatrixStatsAggregate.g.cs | 38 + .../Aggregations/MatrixStatsAggregation.g.cs | 303 ++ .../Types/Aggregations/MatrixStatsFields.g.cs | 50 + .../Types/Aggregations/MaxAggregate.g.cs | 38 + .../Types/Aggregations/MaxAggregation.g.cs | 357 ++ .../MedianAbsoluteDeviationAggregate.g.cs | 38 + .../MedianAbsoluteDeviationAggregation.g.cs | 411 ++ .../Types/Aggregations/MinAggregate.g.cs | 38 + .../Types/Aggregations/MinAggregation.g.cs | 357 ++ .../Types/Aggregations/MissingAggregate.g.cs | 85 + .../Aggregations/MissingAggregation.g.cs | 389 ++ .../Types/Aggregations/MultiTermLookup.g.cs | 158 + .../Aggregations/MultiTermsAggregate.g.cs | 40 + .../Aggregations/MultiTermsAggregation.g.cs | 810 ++++ .../Types/Aggregations/MultiTermsBucket.g.cs | 103 + .../MutualInformationHeuristic.g.cs | 91 + .../Types/Aggregations/NestedAggregate.g.cs | 85 + .../Types/Aggregations/NestedAggregation.g.cs | 344 ++ .../Types/Aggregations/ParentAggregate.g.cs | 85 + .../Types/Aggregations/ParentAggregation.g.cs | 317 ++ .../PercentageScoreHeuristic.g.cs | 45 + .../PercentileRanksAggregation.g.cs | 642 +++ .../Types/Aggregations/Percentiles.g.cs | 42 + .../Aggregations/PercentilesAggregation.g.cs | 642 +++ .../PercentilesBucketAggregate.g.cs | 36 + .../PercentilesBucketAggregation.g.cs | 261 ++ .../Types/Aggregations/RangeAggregate.g.cs | 36 + .../Types/Aggregations/RangeAggregation.g.cs | 660 +++ .../Types/Aggregations/RangeBucket.g.cs | 125 + .../Aggregations/RareTermsAggregation.g.cs | 664 +++ .../Types/Aggregations/RateAggregate.g.cs | 38 + .../Types/Aggregations/RateAggregation.g.cs | 467 ++ .../Aggregations/ReverseNestedAggregate.g.cs | 85 + .../ReverseNestedAggregation.g.cs | 344 ++ .../Types/Aggregations/SamplerAggregate.g.cs | 85 + .../Aggregations/SamplerAggregation.g.cs | 317 ++ .../Types/Aggregations/ScriptedHeuristic.g.cs | 59 + .../Aggregations/ScriptedMetricAggregate.g.cs | 36 + .../ScriptedMetricAggregation.g.cs | 586 +++ .../SignificantStringTermsAggregate.g.cs | 40 + .../SignificantStringTermsBucket.g.cs | 103 + .../SignificantTermsAggregation.g.cs | 1534 +++++++ .../Aggregations/SimpleValueAggregate.g.cs | 38 + .../Aggregations/StandardDeviationBounds.g.cs | 44 + .../StandardDeviationBoundsAsString.g.cs | 44 + .../Types/Aggregations/StatsAggregate.g.cs | 55 + .../Types/Aggregations/StatsAggregation.g.cs | 357 ++ .../Aggregations/StatsBucketAggregate.g.cs | 52 + .../Aggregations/StatsBucketAggregation.g.cs | 222 + .../StringRareTermsAggregate.g.cs | 39 + .../Aggregations/StringRareTermsBucket.g.cs | 85 + .../Aggregations/StringStatsAggregate.g.cs | 52 + .../Aggregations/StringStatsAggregation.g.cs | 367 ++ .../Aggregations/StringTermsAggregate.g.cs | 43 + .../Types/Aggregations/StringTermsBucket.g.cs | 94 + .../Types/Aggregations/SumAggregate.g.cs | 41 + .../Types/Aggregations/SumAggregation.g.cs | 357 ++ .../Types/Aggregations/TDigest.g.cs | 69 + .../TDigestPercentileRanksAggregate.g.cs | 36 + .../TDigestPercentilesAggregate.g.cs | 36 + .../Types/Aggregations/TTestAggregate.g.cs | 38 + .../Types/Aggregations/TTestAggregation.g.cs | 442 ++ .../Types/Aggregations/TermsAggregation.g.cs | 1129 +++++ .../Types/Aggregations/TermsPartition.g.cs | 83 + .../Types/Aggregations/TestPopulation.g.cs | 246 ++ .../Types/Aggregations/TopHitsAggregate.g.cs | 36 + .../Aggregations/TopHitsAggregation.g.cs | 1143 +++++ .../Types/Aggregations/TopMetrics.g.cs | 36 + .../Aggregations/TopMetricsAggregate.g.cs | 36 + .../Aggregations/TopMetricsAggregation.g.cs | 701 +++ .../Types/Aggregations/TopMetricsValue.g.cs | 120 + .../Aggregations/ValueCountAggregate.g.cs | 41 + .../Aggregations/ValueCountAggregation.g.cs | 357 ++ .../VariableWidthHistogramAggregate.g.cs | 36 + .../VariableWidthHistogramAggregation.g.cs | 404 ++ .../VariableWidthHistogramBucket.g.cs | 130 + .../WeightedAverageAggregate.g.cs | 41 + .../WeightedAverageAggregation.g.cs | 487 +++ .../Aggregations/WeightedAverageValue.g.cs | 194 + .../_Generated/Types/Analysis/Analyzers.g.cs | 227 + .../Analysis/AsciiFoldingTokenFilter.g.cs | 91 + .../Types/Analysis/CharFilters.g.cs | 153 + .../Types/Analysis/CharGroupTokenizer.g.cs | 102 + .../Analysis/CommonGramsTokenFilter.g.cs | 138 + .../Types/Analysis/ConditionTokenFilter.g.cs | 98 + .../Types/Analysis/CustomAnalyzer.g.cs | 133 + .../Types/Analysis/CustomNormalizer.g.cs | 89 + .../Analysis/DelimitedPayloadTokenFilter.g.cs | 106 + .../DictionaryDecompounderTokenFilter.g.cs | 186 + .../Types/Analysis/DutchAnalyzer.g.cs | 74 + .../Types/Analysis/EdgeNGramTokenFilter.g.cs | 139 + .../Types/Analysis/EdgeNGramTokenizer.g.cs | 126 + .../Types/Analysis/ElisionTokenFilter.g.cs | 123 + .../Types/Analysis/FingerprintAnalyzer.g.cs | 143 + .../Analysis/FingerprintTokenFilter.g.cs | 106 + .../Types/Analysis/HtmlStripCharFilter.g.cs | 73 + .../Types/Analysis/HunspellTokenFilter.g.cs | 134 + .../HyphenationDecompounderTokenFilter.g.cs | 186 + .../Types/Analysis/IcuAnalyzer.g.cs | 81 + .../Analysis/IcuCollationTokenFilter.g.cs | 266 ++ .../Types/Analysis/IcuFoldingTokenFilter.g.cs | 85 + .../Analysis/IcuNormalizationCharFilter.g.cs | 106 + .../Analysis/IcuNormalizationTokenFilter.g.cs | 86 + .../Types/Analysis/IcuTokenizer.g.cs | 86 + .../Analysis/IcuTransformTokenFilter.g.cs | 102 + .../Types/Analysis/KStemTokenFilter.g.cs | 73 + .../Types/Analysis/KeepTypesTokenFilter.g.cs | 106 + .../Types/Analysis/KeepWordsTokenFilter.g.cs | 122 + .../Types/Analysis/KeywordAnalyzer.g.cs | 73 + .../Analysis/KeywordMarkerTokenFilter.g.cs | 138 + .../Types/Analysis/KeywordTokenizer.g.cs | 86 + .../Types/Analysis/KuromojiAnalyzer.g.cs | 86 + .../KuromojiIterationMarkCharFilter.g.cs | 98 + .../KuromojiPartOfSpeechTokenFilter.g.cs | 86 + .../KuromojiReadingFormTokenFilter.g.cs | 85 + .../Analysis/KuromojiStemmerTokenFilter.g.cs | 86 + .../Types/Analysis/KuromojiTokenizer.g.cs | 182 + .../Types/Analysis/LanguageAnalyzer.g.cs | 131 + .../Types/Analysis/LengthTokenFilter.g.cs | 106 + .../Types/Analysis/LetterTokenizer.g.cs | 73 + .../Analysis/LimitTokenCountTokenFilter.g.cs | 107 + .../Types/Analysis/LowercaseNormalizer.g.cs | 55 + .../Types/Analysis/LowercaseTokenFilter.g.cs | 90 + .../Types/Analysis/LowercaseTokenizer.g.cs | 73 + .../Types/Analysis/MappingCharFilter.g.cs | 106 + .../Analysis/MultiplexerTokenFilter.g.cs | 103 + .../Types/Analysis/NGramTokenFilter.g.cs | 123 + .../Types/Analysis/NGramTokenizer.g.cs | 126 + .../Types/Analysis/NoriAnalyzer.g.cs | 122 + .../Analysis/NoriPartOfSpeechTokenFilter.g.cs | 90 + .../Types/Analysis/NoriTokenizer.g.cs | 138 + .../Types/Analysis/Normalizers.g.cs | 129 + .../Analysis/PathHierarchyTokenizer.g.cs | 137 + .../Types/Analysis/PatternAnalyzer.g.cs | 135 + .../Analysis/PatternCaptureTokenFilter.g.cs | 103 + .../Analysis/PatternReplaceCharFilter.g.cs | 118 + .../Analysis/PatternReplaceTokenFilter.g.cs | 134 + .../Types/Analysis/PatternTokenizer.g.cs | 122 + .../Types/Analysis/PhoneticTokenFilter.g.cs | 154 + .../Types/Analysis/PorterStemTokenFilter.g.cs | 73 + .../Types/Analysis/PredicateTokenFilter.g.cs | 86 + .../Analysis/RemoveDuplicatesTokenFilter.g.cs | 73 + .../Types/Analysis/ReverseTokenFilter.g.cs | 73 + .../Types/Analysis/ShingleTokenFilter.g.cs | 170 + .../Types/Analysis/SimpleAnalyzer.g.cs | 73 + .../Types/Analysis/SnowballAnalyzer.g.cs | 103 + .../Types/Analysis/SnowballTokenFilter.g.cs | 86 + .../Types/Analysis/StandardAnalyzer.g.cs | 90 + .../Types/Analysis/StandardTokenizer.g.cs | 90 + .../Analysis/StemmerOverrideTokenFilter.g.cs | 106 + .../Types/Analysis/StemmerTokenFilter.g.cs | 139 + .../Types/Analysis/StopAnalyzer.g.cs | 107 + .../Types/Analysis/StopTokenFilter.g.cs | 139 + .../Analysis/SynonymGraphTokenFilter.g.cs | 186 + .../Types/Analysis/SynonymTokenFilter.g.cs | 186 + .../Types/Analysis/TokenFilters.g.cs | 497 +++ .../_Generated/Types/Analysis/Tokenizers.g.cs | 225 + .../Types/Analysis/TrimTokenFilter.g.cs | 73 + .../Types/Analysis/TruncateTokenFilter.g.cs | 90 + .../Types/Analysis/UaxEmailUrlTokenizer.g.cs | 90 + .../Types/Analysis/UniqueTokenFilter.g.cs | 90 + .../Types/Analysis/UppercaseTokenFilter.g.cs | 73 + .../Types/Analysis/WhitespaceAnalyzer.g.cs | 73 + .../Types/Analysis/WhitespaceTokenizer.g.cs | 90 + .../WordDelimiterGraphTokenFilter.g.cs | 315 ++ .../Analysis/WordDelimiterTokenFilter.g.cs | 283 ++ .../Types/AsyncSearch/AsyncSearch.g.cs | 72 + .../Types/BulkIndexByScrollFailure.g.cs | 42 + .../_Generated/Types/BulkStats.g.cs | 50 + .../_Generated/Types/ByteSize.g.cs | 42 + .../Types/Cluster/AllocationDecision.g.cs | 38 + .../Types/Cluster/AllocationStore.g.cs | 44 + .../Types/Cluster/CharFilterTypes.g.cs | 73 + .../Types/Cluster/ClusterFileSystem.g.cs | 49 + .../Types/Cluster/ClusterIndices.g.cs | 97 + .../Types/Cluster/ClusterIndicesShards.g.cs | 58 + .../Cluster/ClusterIndicesShardsIndex.g.cs | 49 + .../_Generated/Types/Cluster/ClusterInfo.g.cs | 42 + .../Types/Cluster/ClusterIngest.g.cs | 36 + .../_Generated/Types/Cluster/ClusterJvm.g.cs | 55 + .../Types/Cluster/ClusterJvmMemory.g.cs | 43 + .../Types/Cluster/ClusterJvmVersion.g.cs | 73 + .../Types/Cluster/ClusterNetworkTypes.g.cs | 43 + .../Types/Cluster/ClusterNodeCount.g.cs | 60 + .../Types/Cluster/ClusterNodes.g.cs | 95 + .../Types/Cluster/ClusterOperatingSystem.g.cs | 67 + .../ClusterOperatingSystemArchitecture.g.cs | 43 + .../Cluster/ClusterOperatingSystemName.g.cs | 43 + .../ClusterOperatingSystemPrettyName.g.cs | 43 + .../Types/Cluster/ClusterProcess.g.cs | 43 + .../Types/Cluster/ClusterProcessCpu.g.cs | 37 + .../ClusterProcessOpenFileDescriptors.g.cs | 49 + .../Types/Cluster/ClusterProcessor.g.cs | 42 + .../Types/Cluster/ClusterShardMetrics.g.cs | 49 + .../_Generated/Types/Cluster/CurrentNode.g.cs | 42 + .../_Generated/Types/Cluster/DiskUsage.g.cs | 44 + .../_Generated/Types/Cluster/FieldTypes.g.cs | 73 + .../Types/Cluster/FieldTypesMappings.g.cs | 67 + .../Types/Cluster/IndexHealthStats.g.cs | 50 + .../Types/Cluster/IndexingPressure.g.cs | 34 + .../Types/Cluster/IndexingPressureMemory.g.cs | 38 + .../IndexingPressureMemorySummary.g.cs | 48 + .../Types/Cluster/IndicesVersions.g.cs | 40 + .../Cluster/NodeAllocationExplanation.g.cs | 48 + .../Types/Cluster/NodeDiskUsage.g.cs | 38 + .../Types/Cluster/NodePackagingType.g.cs | 49 + .../Cluster/OperatingSystemMemoryInfo.g.cs | 67 + .../_Generated/Types/Cluster/PendingTask.g.cs | 67 + .../Types/Cluster/ReservedSize.g.cs | 40 + .../Types/Cluster/RuntimeFieldTypes.g.cs | 115 + .../Types/Cluster/ShardHealthStats.g.cs | 44 + .../Types/Cluster/UnassignedInformation.g.cs | 46 + .../_Generated/Types/ClusterDetails.g.cs | 44 + .../_Generated/Types/ClusterStatistics.g.cs | 40 + .../_Generated/Types/CompletionStats.g.cs | 47 + .../_Generated/Types/CoordsGeoBounds.g.cs | 92 + .../Types/Core/Bulk/ResponseItem.g.cs | 55 + .../_Generated/Types/Core/Context.g.cs | 42 + .../Types/Core/Explain/Explanation.g.cs | 38 + .../Types/Core/Explain/ExplanationDetail.g.cs | 38 + .../Types/Core/FieldCaps/FieldCapability.g.cs | 99 + .../_Generated/Types/Core/Get/GetResult.g.cs | 51 + .../Types/Core/MGet/MultiGetError.g.cs | 38 + .../Types/Core/MGet/MultiGetOperation.g.cs | 183 + .../Types/Core/MSearch/MultiSearchItem.g.cs | 62 + .../Types/Core/MSearch/MultisearchBody.g.cs | 2505 +++++++++++ .../Types/Core/MSearch/MultisearchHeader.g.cs | 220 + .../Core/MSearchTemplate/TemplateConfig.g.cs | 137 + .../MultiTermVectorsOperation.g.cs | 480 +++ .../Mtermvectors/MultiTermVectorsResult.g.cs | 47 + .../Types/Core/MultiGetResponseItem.g.cs | 42 + .../Types/Core/MultiSearchResponseItem.g.cs | 42 + .../Types/Core/RankEval/DocumentRating.g.cs | 101 + .../Types/Core/RankEval/RankEvalHit.g.cs | 38 + .../Types/Core/RankEval/RankEvalHitItem.g.cs | 36 + .../Types/Core/RankEval/RankEvalMetric.g.cs | 273 ++ .../Core/RankEval/RankEvalMetricDetail.g.cs | 55 + ...ankEvalMetricDiscountedCumulativeGain.g.cs | 91 + .../RankEvalMetricExpectedReciprocalRank.g.cs | 87 + .../RankEvalMetricMeanReciprocalRank.g.cs | 84 + .../RankEval/RankEvalMetricPrecision.g.cs | 105 + .../Core/RankEval/RankEvalMetricRecall.g.cs | 84 + .../Types/Core/RankEval/RankEvalQuery.g.cs | 180 + .../Core/RankEval/RankEvalRequestItem.g.cs | 421 ++ .../Types/Core/RankEval/UnratedDocument.g.cs | 36 + .../Core/Search/AggregationBreakdown.g.cs | 56 + .../Types/Core/Search/AggregationProfile.g.cs | 44 + .../Core/Search/AggregationProfileDebug.g.cs | 88 + ...AggregationProfileDelegateDebugFilter.g.cs | 40 + .../Types/Core/Search/Collector.g.cs | 40 + .../Types/Core/Search/CompletionContext.g.cs | 119 + .../Core/Search/CompletionSuggester.g.cs | 392 ++ .../Types/Core/Search/DirectGenerator.g.cs | 382 ++ .../Types/Core/Search/FetchProfile.g.cs | 44 + .../Core/Search/FetchProfileBreakdown.g.cs | 48 + .../Types/Core/Search/FetchProfileDebug.g.cs | 36 + .../Types/Core/Search/FieldCollapse.g.cs | 397 ++ .../Types/Core/Search/FieldSuggester.g.cs | 377 ++ .../Types/Core/Search/Highlight.g.cs | 760 ++++ .../Types/Core/Search/HighlightField.g.cs | 796 ++++ .../_Generated/Types/Core/Search/Hit.g.cs | 71 + .../Types/Core/Search/HitsMetadata.g.cs | 42 + .../Types/Core/Search/InnerHits.g.cs | 900 ++++ .../Types/Core/Search/InnerHitsResult.g.cs | 34 + .../Core/Search/LaplaceSmoothingModel.g.cs | 61 + .../LinearInterpolationSmoothingModel.g.cs | 83 + .../Types/Core/Search/NestedIdentity.g.cs | 38 + .../Core/Search/PhraseSuggestCollate.g.cs | 123 + .../Search/PhraseSuggestCollateQuery.g.cs | 78 + .../Core/Search/PhraseSuggestHighlight.g.cs | 70 + .../Types/Core/Search/PhraseSuggester.g.cs | 820 ++++ .../Core/Search/PointInTimeReference.g.cs | 74 + .../_Generated/Types/Core/Search/Profile.g.cs | 34 + .../Types/Core/Search/QueryBreakdown.g.cs | 68 + .../Types/Core/Search/QueryProfile.g.cs | 42 + .../Types/Core/Search/RegexOptions.g.cs | 78 + .../_Generated/Types/Core/Search/Rescore.g.cs | 180 + .../Types/Core/Search/RescoreQuery.g.cs | 275 ++ .../Types/Core/Search/SearchProfile.g.cs | 38 + .../Types/Core/Search/ShardProfile.g.cs | 40 + .../Types/Core/Search/SmoothingModel.g.cs | 236 ++ .../Types/Core/Search/SourceFilter.g.cs | 125 + .../Search/StupidBackoffSmoothingModel.g.cs | 61 + .../Types/Core/Search/SuggestFuzziness.g.cs | 123 + .../Types/Core/Search/Suggester.g.cs | 138 + .../Types/Core/Search/TermSuggester.g.cs | 496 +++ .../Types/Core/Search/TotalHits.g.cs | 36 + .../_Generated/Types/Core/SourceConfig.g.cs | 42 + .../Types/Core/SourceConfigParam.g.cs | 42 + .../Core/TermVectors/FieldStatistics.g.cs | 38 + .../Types/Core/TermVectors/Filter.g.cs | 153 + .../Types/Core/TermVectors/Term.g.cs | 42 + .../Types/Core/TermVectors/TermVector.g.cs | 36 + .../Types/Core/TermVectors/Token.g.cs | 40 + .../_Generated/Types/Core/TrackHits.g.cs | 42 + .../_Generated/Types/DocStats.g.cs | 43 + .../Types/ElasticsearchVersionInfo.g.cs | 50 + .../_Generated/Types/EmptyObject.g.cs | 51 + .../_Generated/Types/Enrich/CacheStats.g.cs | 42 + .../Types/Enrich/CoordinatorStats.g.cs | 42 + .../_Generated/Types/Enrich/EnrichPolicy.g.cs | 226 + .../Types/Enrich/EnrichSummary.g.cs | 34 + .../Enrich/ExecuteEnrichPolicyStatus.g.cs | 34 + .../Types/Enrich/ExecutingPolicy.g.cs | 36 + .../Types/Enums/Enums.Aggregations.g.cs | 731 ++++ .../Types/Enums/Enums.Analysis.g.cs | 1437 +++++++ .../_Generated/Types/Enums/Enums.Cluster.g.cs | 299 ++ .../Types/Enums/Enums.Core.Search.g.cs | 500 +++ .../_Generated/Types/Enums/Enums.Enrich.g.cs | 132 + .../Types/Enums/Enums.IndexManagement.g.cs | 590 +++ .../_Generated/Types/Enums/Enums.Ingest.g.cs | 290 ++ .../_Generated/Types/Enums/Enums.Mapping.g.cs | 902 ++++ .../_Generated/Types/Enums/Enums.Ml.g.cs | 77 + .../Types/Enums/Enums.NoNamespace.g.cs | 1485 +++++++ .../Types/Enums/Enums.QueryDsl.g.cs | 921 ++++ .../_Generated/Types/Enums/Enums.Watcher.g.cs | 84 + .../_Generated/Types/ErrorCause.g.cs | 124 + .../_Generated/Types/ErrorResponseBase.g.cs | 40 + .../Types/ExpandWildcardsConverter.g.cs | 35 + .../_Generated/Types/FeaturesConverter.g.cs | 35 + .../_Generated/Types/FieldMemoryUsage.g.cs | 36 + .../_Generated/Types/FieldSizeUsage.g.cs | 36 + .../_Generated/Types/FieldSort.g.cs | 320 ++ .../_Generated/Types/FielddataStats.g.cs | 41 + .../_Generated/Types/FlushStats.g.cs | 40 + .../_Generated/Types/Fuzziness.g.cs | 42 + .../_Generated/Types/GeoBounds.g.cs | 141 + .../_Generated/Types/GeoDistanceSort.g.cs | 364 ++ .../_Generated/Types/GeoHashLocation.g.cs | 59 + .../_Generated/Types/GeoLine.g.cs | 46 + .../_Generated/Types/GeoLocation.g.cs | 142 + .../_Generated/Types/GeohashPrecision.g.cs | 42 + .../_Generated/Types/GetStats.g.cs | 52 + .../_Generated/Types/Graph/Connection.g.cs | 40 + .../Types/Graph/ExploreControls.g.cs | 267 ++ .../_Generated/Types/Graph/Hop.g.cs | 413 ++ .../Types/Graph/SampleDiversity.g.cs | 122 + .../_Generated/Types/Graph/Vertex.g.cs | 40 + .../Types/Graph/VertexDefinition.g.cs | 426 ++ .../_Generated/Types/Graph/VertexInclude.g.cs | 70 + .../Types/IndexManagement/Action.g.cs | 237 ++ .../Types/IndexManagement/AddAction.g.cs | 543 +++ .../Types/IndexManagement/Alias.g.cs | 351 ++ .../IndexManagement/AliasDefinition.g.cs | 67 + .../Types/IndexManagement/CacheQueries.g.cs | 59 + .../IndexManagement/CloseIndexResult.g.cs | 36 + .../IndexManagement/CloseShardResult.g.cs | 34 + .../Types/IndexManagement/DataLifecycle.g.cs | 69 + .../IndexManagement/DataLifecycleExplain.g.cs | 50 + .../DataLifecycleWithRollover.g.cs | 46 + .../Types/IndexManagement/DataStream.g.cs | 109 + .../IndexManagement/DataStreamIndex.g.cs | 43 + .../IndexManagement/DataStreamLifecycle.g.cs | 36 + .../DataStreamTimestampField.g.cs | 37 + .../IndexManagement/DataStreamVisibility.g.cs | 63 + .../DlmRolloverConditions.g.cs | 52 + .../FielddataFrequencyFilter.g.cs | 88 + .../Types/IndexManagement/IndexAliases.g.cs | 34 + .../IndexManagement/IndexMappingRecord.g.cs | 36 + .../Types/IndexManagement/IndexRouting.g.cs | 138 + .../IndexRoutingAllocation.g.cs | 198 + .../IndexRoutingAllocationDisk.g.cs | 63 + .../IndexRoutingAllocationInclude.g.cs | 78 + ...IndexRoutingAllocationInitialRecovery.g.cs | 63 + .../IndexRoutingRebalance.g.cs | 59 + .../IndexManagement/IndexSegmentSort.g.cs | 176 + .../IndexManagement/IndexSettingBlocks.g.cs | 128 + .../Types/IndexManagement/IndexSettings.g.cs | 3732 ++++++++++++++++ .../IndexSettingsAnalysis.g.cs | 193 + .../IndexSettingsLifecycle.g.cs | 199 + .../IndexSettingsLifecycleStep.g.cs | 69 + .../IndexSettingsTimeSeries.g.cs | 78 + .../Types/IndexManagement/IndexState.g.cs | 492 +++ .../Types/IndexManagement/IndexStats.g.cs | 138 + .../Types/IndexManagement/IndexTemplate.g.cs | 75 + .../IndexTemplateDataStreamConfiguration.g.cs | 43 + .../IndexManagement/IndexTemplateItem.g.cs | 36 + .../IndexManagement/IndexTemplateMapping.g.cs | 385 ++ .../IndexManagement/IndexTemplateSummary.g.cs | 52 + .../IndexManagement/IndexVersioning.g.cs | 78 + .../IndexManagement/IndexingPressure.g.cs | 93 + .../IndexingPressureMemory.g.cs | 69 + .../IndexingSlowlogSettings.g.cs | 138 + .../IndexingSlowlogTresholds.g.cs | 99 + .../Types/IndexManagement/IndicesStats.g.cs | 44 + .../IndexManagement/MappingLimitSettings.g.cs | 354 ++ .../MappingLimitSettingsDepth.g.cs | 69 + .../MappingLimitSettingsDimensionFields.g.cs | 69 + .../MappingLimitSettingsFieldNameLength.g.cs | 69 + .../MappingLimitSettingsNestedFields.g.cs | 69 + .../MappingLimitSettingsNestedObjects.g.cs | 69 + .../MappingLimitSettingsTotalFields.g.cs | 69 + .../Types/IndexManagement/MappingStats.g.cs | 38 + .../Types/IndexManagement/Merge.g.cs | 93 + .../Types/IndexManagement/MergeScheduler.g.cs | 80 + .../IndexManagement/NumericFielddata.g.cs | 64 + .../Types/IndexManagement/Overlapping.g.cs | 36 + .../Types/IndexManagement/Queries.g.cs | 93 + .../Types/IndexManagement/RemoveAction.g.cs | 159 + .../IndexManagement/RemoveIndexAction.g.cs | 115 + .../Types/IndexManagement/RetentionLease.g.cs | 59 + .../IndexManagement/RolloverConditions.g.cs | 273 ++ .../Types/IndexManagement/SearchIdle.g.cs | 63 + .../IndexManagement/SettingsAnalyze.g.cs | 64 + .../IndexManagement/SettingsHighlight.g.cs | 63 + .../IndexManagement/SettingsQueryString.g.cs | 60 + .../Types/IndexManagement/SettingsSearch.g.cs | 138 + .../IndexManagement/SettingsSimilarity.g.cs | 363 ++ .../SettingsSimilarityBm25.g.cs | 86 + .../SettingsSimilarityDfi.g.cs | 64 + .../SettingsSimilarityDfr.g.cs | 86 + .../IndexManagement/SettingsSimilarityIb.g.cs | 86 + .../SettingsSimilarityLmd.g.cs | 64 + .../SettingsSimilarityLmj.g.cs | 64 + .../SettingsSimilarityScriptedTfidf.g.cs | 64 + .../Types/IndexManagement/ShardCommit.g.cs | 40 + .../IndexManagement/ShardFileSizeInfo.g.cs | 44 + .../Types/IndexManagement/ShardLease.g.cs | 40 + .../Types/IndexManagement/ShardPath.g.cs | 38 + .../IndexManagement/ShardQueryCache.g.cs | 46 + .../IndexManagement/ShardRetentionLeases.g.cs | 38 + .../Types/IndexManagement/ShardRouting.g.cs | 40 + .../IndexManagement/ShardSequenceNumber.g.cs | 38 + .../Types/IndexManagement/ShardStats.g.cs | 83 + .../IndexManagement/ShardsTotalStats.g.cs | 34 + .../IndexManagement/SlowlogSettings.g.cs | 138 + .../SlowlogTresholdLevels.g.cs | 108 + .../IndexManagement/SlowlogTresholds.g.cs | 138 + .../Types/IndexManagement/SoftDeletes.g.cs | 121 + .../Types/IndexManagement/Storage.g.cs | 80 + .../Types/IndexManagement/Template.g.cs | 39 + .../IndexManagement/TemplateMapping.g.cs | 45 + .../Types/IndexManagement/Translog.g.cs | 158 + .../IndexManagement/TranslogRetention.g.cs | 91 + .../_Generated/Types/IndexingStats.g.cs | 62 + .../Types/Ingest/AppendProcessor.g.cs | 446 ++ .../Types/Ingest/AttachmentProcessor.g.cs | 661 +++ .../Types/Ingest/BytesProcessor.g.cs | 482 +++ .../Types/Ingest/CircleProcessor.g.cs | 542 +++ .../Types/Ingest/ConvertProcessor.g.cs | 512 +++ .../_Generated/Types/Ingest/CsvProcessor.g.cs | 599 +++ .../Types/Ingest/DateIndexNameProcessor.g.cs | 590 +++ .../Types/Ingest/DateProcessor.g.cs | 550 +++ .../Types/Ingest/DissectProcessor.g.cs | 484 +++ .../_Generated/Types/Ingest/Document.g.cs | 109 + .../Types/Ingest/DocumentSimulation.g.cs | 136 + .../Types/Ingest/DotExpanderProcessor.g.cs | 417 ++ .../Types/Ingest/DropProcessor.g.cs | 322 ++ .../Types/Ingest/EnrichProcessor.g.cs | 618 +++ .../Types/Ingest/FailProcessor.g.cs | 352 ++ .../Types/Ingest/ForeachProcessor.g.cs | 515 +++ .../Types/Ingest/GeoIpDownloadStatistics.g.cs | 61 + .../Types/Ingest/GeoIpNodeDatabaseName.g.cs | 37 + .../Types/Ingest/GeoIpNodeDatabases.g.cs | 46 + .../Types/Ingest/GeoIpProcessor.g.cs | 595 +++ .../Types/Ingest/GrokProcessor.g.cs | 523 +++ .../Types/Ingest/GsubProcessor.g.cs | 542 +++ .../Types/Ingest/InferenceConfig.g.cs | 223 + .../Ingest/InferenceConfigClassification.g.cs | 309 ++ .../Ingest/InferenceConfigRegression.g.cs | 168 + .../Types/Ingest/InferenceProcessor.g.cs | 553 +++ .../_Generated/Types/Ingest/IngestInfo.g.cs | 36 + .../Types/Ingest/JoinProcessor.g.cs | 474 +++ .../Types/Ingest/JsonProcessor.g.cs | 557 +++ .../Types/Ingest/KeyValueProcessor.g.cs | 770 ++++ .../Types/Ingest/LowercaseProcessor.g.cs | 482 +++ .../_Generated/Types/Ingest/Pipeline.g.cs | 447 ++ .../Types/Ingest/PipelineProcessor.g.cs | 390 ++ .../Types/Ingest/PipelineSimulation.g.cs | 42 + .../_Generated/Types/Ingest/Processor.g.cs | 719 ++++ .../Types/Ingest/RemoveProcessor.g.cs | 390 ++ .../Types/Ingest/RenameProcessor.g.cs | 474 +++ .../_Generated/Types/Ingest/SetProcessor.g.cs | 595 +++ .../Ingest/SetSecurityUserProcessor.g.cs | 417 ++ .../Types/Ingest/SortProcessor.g.cs | 482 +++ .../Types/Ingest/SplitProcessor.g.cs | 550 +++ .../Types/Ingest/TrimProcessor.g.cs | 482 +++ .../Types/Ingest/UppercaseProcessor.g.cs | 482 +++ .../Types/Ingest/UrlDecodeProcessor.g.cs | 482 +++ .../Types/Ingest/UserAgentProcessor.g.cs | 548 +++ .../_Generated/Types/InlineGet.g.cs | 47 + .../_Generated/Types/InlineScript.g.cs | 117 + .../_Generated/Types/KnnQuery.g.cs | 542 +++ .../_Generated/Types/LatLonGeoLocation.g.cs | 83 + .../AggregateMetricDoubleProperty.g.cs | 359 ++ .../_Generated/Types/Mapping/AllField.g.cs | 158 + .../Types/Mapping/BinaryProperty.g.cs | 405 ++ .../Types/Mapping/BooleanProperty.g.cs | 633 +++ .../Types/Mapping/ByteNumberProperty.g.cs | 675 +++ .../Types/Mapping/CompletionProperty.g.cs | 701 +++ .../Mapping/ConstantKeywordProperty.g.cs | 316 ++ .../Types/Mapping/DataStreamTimestamp.g.cs | 59 + .../Types/Mapping/DateNanosProperty.g.cs | 585 +++ .../Types/Mapping/DateProperty.g.cs | 753 ++++ .../Types/Mapping/DateRangeProperty.g.cs | 525 +++ .../Mapping/DenseVectorIndexOptions.g.cs | 88 + .../Types/Mapping/DenseVectorProperty.g.cs | 505 +++ .../Types/Mapping/DoubleNumberProperty.g.cs | 675 +++ .../Types/Mapping/DoubleRangeProperty.g.cs | 495 +++ .../Types/Mapping/DynamicProperty.g.cs | 1173 +++++ .../Types/Mapping/DynamicTemplate.g.cs | 153 + .../Types/Mapping/FieldAliasProperty.g.cs | 333 ++ .../Types/Mapping/FieldNamesField.g.cs | 59 + .../Types/Mapping/FlattenedProperty.g.cs | 555 +++ .../Types/Mapping/FloatNumberProperty.g.cs | 675 +++ .../Types/Mapping/FloatRangeProperty.g.cs | 495 +++ .../Types/Mapping/GeoPointProperty.g.cs | 495 +++ .../Types/Mapping/GeoShapeProperty.g.cs | 564 +++ .../Mapping/HalfFloatNumberProperty.g.cs | 675 +++ .../Types/Mapping/HistogramProperty.g.cs | 315 ++ .../_Generated/Types/Mapping/IndexField.g.cs | 59 + .../Types/Mapping/IntegerNumberProperty.g.cs | 675 +++ .../Types/Mapping/IntegerRangeProperty.g.cs | 495 +++ .../_Generated/Types/Mapping/IpProperty.g.cs | 625 +++ .../Types/Mapping/IpRangeProperty.g.cs | 495 +++ .../Types/Mapping/JoinProperty.g.cs | 345 ++ .../Types/Mapping/KeywordProperty.g.cs | 685 +++ .../Types/Mapping/LongNumberProperty.g.cs | 675 +++ .../Types/Mapping/LongRangeProperty.g.cs | 495 +++ .../Types/Mapping/MatchOnlyTextProperty.g.cs | 247 ++ .../Types/Mapping/Murmur3HashProperty.g.cs | 405 ++ .../Types/Mapping/NestedProperty.g.cs | 465 ++ .../Types/Mapping/ObjectProperty.g.cs | 405 ++ .../Types/Mapping/PercolatorProperty.g.cs | 285 ++ .../Types/Mapping/PointProperty.g.cs | 495 +++ .../_Generated/Types/Mapping/Properties.g.cs | 575 +++ .../Types/Mapping/RankFeatureProperty.g.cs | 315 ++ .../Types/Mapping/RankFeaturesProperty.g.cs | 285 ++ .../Types/Mapping/RoutingField.g.cs | 59 + .../Types/Mapping/RuntimeField.g.cs | 491 +++ .../Mapping/RuntimeFieldFetchFields.g.cs | 130 + .../Mapping/ScaledFloatNumberProperty.g.cs | 705 +++ .../Mapping/SearchAsYouTypeProperty.g.cs | 615 +++ .../Types/Mapping/ShapeProperty.g.cs | 534 +++ .../Types/Mapping/ShortNumberProperty.g.cs | 675 +++ .../_Generated/Types/Mapping/SizeField.g.cs | 59 + .../_Generated/Types/Mapping/SourceField.g.cs | 138 + .../Types/Mapping/SuggestContext.g.cs | 178 + .../Types/Mapping/TextIndexPrefixes.g.cs | 76 + .../Types/Mapping/TextProperty.g.cs | 1011 +++++ .../Types/Mapping/TokenCountProperty.g.cs | 555 +++ .../_Generated/Types/Mapping/TypeMapping.g.cs | 960 +++++ .../Mapping/UnsignedLongNumberProperty.g.cs | 675 +++ .../Types/Mapping/VersionProperty.g.cs | 405 ++ .../Types/Mapping/WildcardProperty.g.cs | 435 ++ .../_Generated/Types/MergesStats.g.cs | 64 + .../Ml/ClassificationInferenceOptions.g.cs | 157 + .../Types/Ml/FillMaskInferenceOptions.g.cs | 173 + .../Ml/FillMaskInferenceUpdateOptions.g.cs | 145 + .../Types/Ml/InferenceConfigCreate.g.cs | 345 ++ .../Types/Ml/InferenceConfigUpdate.g.cs | 342 ++ .../Types/Ml/NerInferenceOptions.g.cs | 196 + .../Types/Ml/NerInferenceUpdateOptions.g.cs | 123 + .../Types/Ml/NlpBertTokenizationConfig.g.cs | 163 + .../Ml/NlpRobertaTokenizationConfig.g.cs | 165 + .../Ml/NlpTokenizationUpdateOptions.g.cs | 91 + .../Types/Ml/PassThroughInferenceOptions.g.cs | 174 + .../Ml/PassThroughInferenceUpdateOptions.g.cs | 123 + .../Ml/QuestionAnsweringInferenceOptions.g.cs | 173 + ...estionAnsweringInferenceUpdateOptions.g.cs | 185 + .../Types/Ml/RegressionInferenceOptions.g.cs | 166 + .../TextClassificationInferenceOptions.g.cs | 173 + ...tClassificationInferenceUpdateOptions.g.cs | 167 + .../Ml/TextEmbeddingInferenceOptions.g.cs | 151 + .../TextEmbeddingInferenceUpdateOptions.g.cs | 116 + .../Ml/TextExpansionInferenceOptions.g.cs | 129 + .../TextExpansionInferenceUpdateOptions.g.cs | 116 + .../Types/Ml/TokenizationConfig.g.cs | 239 ++ .../_Generated/Types/Ml/Vocabulary.g.cs | 59 + ...eroShotClassificationInferenceOptions.g.cs | 213 + ...tClassificationInferenceUpdateOptions.g.cs | 163 + .../_Generated/Types/NestedSortValue.g.cs | 306 ++ .../_Generated/Types/NodeStatistics.g.cs | 54 + .../_Generated/Types/PluginStats.g.cs | 50 + .../_Generated/Types/QueryCacheStats.g.cs | 79 + .../_Generated/Types/QueryDsl/BoolQuery.g.cs | 762 ++++ .../Types/QueryDsl/BoostingQuery.g.cs | 350 ++ .../Types/QueryDsl/CombinedFieldsQuery.g.cs | 336 ++ .../Types/QueryDsl/ConstantScoreQuery.g.cs | 222 + .../Types/QueryDsl/DateRangeQuery.g.cs | 668 +++ .../Types/QueryDsl/DisMaxQuery.g.cs | 316 ++ .../Types/QueryDsl/ExistsQuery.g.cs | 181 + .../Types/QueryDsl/FieldAndFormat.g.cs | 195 + .../FieldValueFactorScoreFunction.g.cs | 236 ++ .../Types/QueryDsl/FunctionScore.g.cs | 394 ++ .../Types/QueryDsl/FunctionScoreQuery.g.cs | 528 +++ .../_Generated/Types/QueryDsl/FuzzyQuery.g.cs | 539 +++ .../Types/QueryDsl/GeoBoundingBoxQuery.g.cs | 347 ++ .../Types/QueryDsl/GeoDistanceQuery.g.cs | 384 ++ .../Types/QueryDsl/GeoPolygonPoints.g.cs | 59 + .../Types/QueryDsl/GeoPolygonQuery.g.cs | 387 ++ .../Types/QueryDsl/HasChildQuery.g.cs | 502 +++ .../Types/QueryDsl/HasParentQuery.g.cs | 426 ++ .../_Generated/Types/QueryDsl/IdsQuery.g.cs | 104 + .../_Generated/Types/QueryDsl/Intervals.g.cs | 287 ++ .../Types/QueryDsl/IntervalsAllOf.g.cs | 391 ++ .../Types/QueryDsl/IntervalsAnyOf.g.cs | 315 ++ .../Types/QueryDsl/IntervalsFilter.g.cs | 185 + .../Types/QueryDsl/IntervalsFuzzy.g.cs | 310 ++ .../Types/QueryDsl/IntervalsMatch.g.cs | 370 ++ .../Types/QueryDsl/IntervalsPrefix.g.cs | 196 + .../Types/QueryDsl/IntervalsQuery.g.cs | 466 ++ .../Types/QueryDsl/IntervalsWildcard.g.cs | 196 + .../_Generated/Types/QueryDsl/Like.g.cs | 42 + .../Types/QueryDsl/LikeDocument.g.cs | 317 ++ .../Types/QueryDsl/MatchAllQuery.g.cs | 82 + .../Types/QueryDsl/MatchBoolPrefixQuery.g.cs | 686 +++ .../Types/QueryDsl/MatchNoneQuery.g.cs | 82 + .../QueryDsl/MatchPhrasePrefixQuery.g.cs | 490 +++ .../Types/QueryDsl/MatchPhraseQuery.g.cs | 441 ++ .../_Generated/Types/QueryDsl/MatchQuery.g.cs | 833 ++++ .../Types/QueryDsl/MoreLikeThisQuery.g.cs | 809 ++++ .../Types/QueryDsl/MultiMatchQuery.g.cs | 724 ++++ .../Types/QueryDsl/NestedQuery.g.cs | 453 ++ .../Types/QueryDsl/NumberRangeQuery.g.cs | 570 +++ .../Types/QueryDsl/ParentIdQuery.g.cs | 148 + .../Types/QueryDsl/PercolateQuery.g.cs | 485 +++ .../_Generated/Types/QueryDsl/PinnedDoc.g.cs | 83 + .../Types/QueryDsl/PinnedQuery.g.cs | 419 ++ .../Types/QueryDsl/PrefixQuery.g.cs | 392 ++ .../_Generated/Types/QueryDsl/Query.g.cs | 1038 +++++ .../Types/QueryDsl/QueryStringQuery.g.cs | 1083 +++++ .../Types/QueryDsl/RandomScoreFunction.g.cs | 140 + .../QueryDsl/RankFeatureFunctionLinear.g.cs | 45 + .../RankFeatureFunctionLogarithm.g.cs | 65 + .../RankFeatureFunctionSaturation.g.cs | 69 + .../QueryDsl/RankFeatureFunctionSigmoid.g.cs | 83 + .../Types/QueryDsl/RankFeatureQuery.g.cs | 573 +++ .../Types/QueryDsl/RegexpQuery.g.cs | 490 +++ .../_Generated/Types/QueryDsl/RuleQuery.g.cs | 252 ++ .../Types/QueryDsl/ScriptQuery.g.cs | 100 + .../Types/QueryDsl/ScriptScoreFunction.g.cs | 67 + .../Types/QueryDsl/ScriptScoreQuery.g.cs | 290 ++ .../QueryDsl/SimpleQueryStringQuery.g.cs | 610 +++ .../Types/QueryDsl/SpanContainingQuery.g.cs | 318 ++ .../Types/QueryDsl/SpanFieldMaskingQuery.g.cs | 248 ++ .../Types/QueryDsl/SpanFirstQuery.g.cs | 250 ++ .../Types/QueryDsl/SpanMultiTermQuery.g.cs | 220 + .../Types/QueryDsl/SpanNearQuery.g.cs | 352 ++ .../Types/QueryDsl/SpanNotQuery.g.cs | 432 ++ .../Types/QueryDsl/SpanOrQuery.g.cs | 276 ++ .../_Generated/Types/QueryDsl/SpanQuery.g.cs | 335 ++ .../Types/QueryDsl/SpanTermQuery.g.cs | 282 ++ .../Types/QueryDsl/SpanWithinQuery.g.cs | 318 ++ .../_Generated/Types/QueryDsl/TermQuery.g.cs | 343 ++ .../Types/QueryDsl/TermsLookup.g.cs | 170 + .../_Generated/Types/QueryDsl/TermsQuery.g.cs | 249 ++ .../Types/QueryDsl/TermsQueryField.g.cs | 42 + .../Types/QueryDsl/TermsSetQuery.g.cs | 419 ++ .../Types/QueryDsl/TextExpansionQuery.g.cs | 331 ++ .../Types/QueryDsl/WildcardQuery.g.cs | 453 ++ .../Types/QueryDsl/WrapperQuery.g.cs | 100 + .../_Generated/Types/QueryVectorBuilder.g.cs | 206 + .../_Generated/Types/Rank.g.cs | 206 + .../_Generated/Types/RecoveryStats.g.cs | 40 + .../_Generated/Types/RefreshStats.g.cs | 44 + .../_Generated/Types/RequestCacheStats.g.cs | 42 + .../_Generated/Types/Retries.g.cs | 36 + .../_Generated/Types/RrfRank.g.cs | 93 + .../_Generated/Types/ScoreSort.g.cs | 63 + .../_Generated/Types/Script.g.cs | 42 + .../_Generated/Types/ScriptField.g.cs | 74 + .../_Generated/Types/ScriptSort.g.cs | 258 ++ .../_Generated/Types/SearchStats.g.cs | 68 + .../_Generated/Types/SegmentsStats.g.cs | 167 + .../_Generated/Types/ShardFailure.g.cs | 42 + .../_Generated/Types/ShardStatistics.g.cs | 50 + .../_Generated/Types/SlicedScroll.g.cs | 150 + .../_Generated/Types/Slices.g.cs | 42 + .../_Generated/Types/SortOptions.g.cs | 296 ++ .../_Generated/Types/StopWordsConverter.g.cs | 35 + .../_Generated/Types/StoreStats.g.cs | 67 + .../_Generated/Types/StoredScript.g.cs | 98 + .../_Generated/Types/StoredScriptId.g.cs | 80 + .../_Generated/Types/Tasks/TaskInfo.g.cs | 62 + .../_Generated/Types/TextEmbedding.g.cs | 72 + .../Types/TopLeftBottomRightGeoBounds.g.cs | 70 + .../Types/TopRightBottomLeftGeoBounds.g.cs | 70 + .../TransformManagement/PivotGroupBy.g.cs | 255 ++ .../_Generated/Types/TranslogStats.g.cs | 46 + .../_Generated/Types/WarmerStats.g.cs | 40 + .../_Generated/Types/WktGeoBounds.g.cs | 59 + .../packages.lock.json | 942 ++++ .../Api/AsyncSearch/GetAsyncSearchRequest.cs | 4 + .../AsyncSearch/SubmitAsyncSearchRequest.cs | 8 + .../Api/BulkRequest.cs | 16 + .../Api/BulkResponse.cs | 8 + .../Api/CountRequest.cs | 8 + .../Api/CreateRequest.cs | 8 + .../Api/DeleteRequest.cs | 4 + .../Api/Eql/EqlGetResponse.cs | 6 + .../Api/ExistsRequest.cs | 4 + .../Api/GetSourceRequestDescriptor.cs | 4 + .../Api/GetSourceResponse.cs | 8 + .../Api/IndexManagement/GetAliasResponse.cs | 4 + .../GetFieldMappingResponse.cs | 6 + .../Api/IndexManagement/GetIndexResponse.cs | 4 + .../Api/IndexManagement/GetMappingResponse.cs | 8 + .../IndexManagement/GetTemplateResponse.cs | 4 + .../Api/IndexRequest.cs | 12 + .../Api/Ingest/GetPipelineResponse.cs | 4 + .../Api/Ingest/Processor.cs | 4 + .../Api/MultiSearchRequest.cs | 4 + .../Api/ResponseItem.cs | 4 + .../Api/ScrollResponse.cs | 4 + .../Api/SearchRequest.cs | 8 + .../Api/SearchResponse.cs | 6 +- .../Api/Sql/GetAsyncResponse.cs | 4 + .../Api/Sql/QueryResponse.cs | 4 + .../Client/ElasticsearchClient-BulkAll.cs | 18 +- .../Client/ElasticsearchClient-Manual.cs | 4 + .../ElasticsearchResponseBaseExtensions.cs | 4 + .../Client/IndexManyExtensions.cs | 8 + .../Client/IndicesNamespace.cs | 10 +- .../Client/NamespacedClientProxy.cs | 10 +- .../Aggregations/AggregationCombinator.cs | 4 + .../Aggregations/AggregationDictionary.cs | 4 + .../Core/Aggregations/IAggregate.cs | 4 + .../Core/Aggregations/SearchAggregation.cs | 4 + .../Core/Configuration/ClrTypeDefaults.cs | 8 + .../ElasticsearchClientSettings.cs | 14 +- .../IElasticsearchClientSettings.cs | 8 + .../Core/Configuration/MemberInfoResolver.cs | 4 + .../Core/DateTime/DateMath/DateMath.cs | 8 +- .../DateTime/DateMath/DateMathExpression.cs | 4 + .../DateTime/DateMath/DateMathOperation.cs | 8 + .../Core/DateTime/DateMath/DateMathTime.cs | 4 + .../DateTime/DateMath/DateMathTimeUnit.cs | 8 + .../Core/DateTime/Duration.cs | 4 + .../Core/DateTime/TimeUnit.cs | 4 + .../Core/EmptyReadOnly.cs | 4 + .../Core/EmptyReadOnlyExtensions.cs | 4 + .../Core/Exceptions/ThrowHelper.cs | 4 + .../Core/Extensions/ExceptionExtensions.cs | 4 + .../Core/Extensions/ExpressionExtensions.cs | 4 + .../Core/Extensions/Extensions.cs | 4 + .../Core/Extensions/StringExtensions.cs | 4 + .../Core/Extensions/SuffixExtensions.cs | 4 + .../Core/Extensions/TaskExtensions.cs | 4 + .../Core/Extensions/TypeExtensions.cs | 4 + .../Core/Fields/FieldValue.cs | 8 + .../Core/Fields/FieldValues.cs | 8 + .../Core/Fluent/Descriptor.cs | 8 + .../Core/Fluent/Fluent.cs | 4 + .../Core/Fluent/FluentDictionary.cs | 4 + .../Core/Fluent/IBuildableDescriptor.cs | 4 + .../Core/Fluent/Promise/IPromise.cs | 4 + .../Fluent/Promise/IsADictionaryDescriptor.cs | 4 + .../Core/Fluent/Promise/PromiseDescriptor.cs | 4 + .../Core/IComplexUnion.cs | 4 + .../Core/IEnumStruct.cs | 4 + .../Infer/DefaultPropertyMappingProvider.cs | 4 + .../Core/Infer/DocumentPath/DocumentPath.cs | 8 + .../Core/Infer/Field/Field.cs | 4 + .../Core/Infer/Field/FieldConverter.cs | 8 + .../Infer/Field/FieldExpressionVisitor.cs | 4 + .../Core/Infer/Field/FieldExtensions.cs | 4 + .../Core/Infer/Field/FieldResolver.cs | 4 + .../Infer/Field/ToStringExpressionVisitor.cs | 4 + .../Core/Infer/Fields/Fields.cs | 4 + .../Core/Infer/Fields/FieldsConverter.cs | 4 + .../Core/Infer/Fields/FieldsDescriptor.cs | 4 + .../Core/Infer/IPropertyMappingProvider.cs | 4 + .../Core/Infer/Id/Id.cs | 4 + .../Core/Infer/Id/IdConverter.cs | 8 + .../Core/Infer/Id/IdExtensions.cs | 4 + .../Core/Infer/Id/IdResolver.cs | 4 + .../Core/Infer/Id/Ids.cs | 4 + .../Core/Infer/Id/IdsConverter.cs | 4 + .../Core/Infer/IndexName/IndexName.cs | 4 + .../Infer/IndexName/IndexNameConverter.cs | 8 + .../Infer/IndexName/IndexNameExtensions.cs | 4 + .../Core/Infer/IndexName/IndexNameResolver.cs | 4 + .../Core/Infer/Indices/Indices.cs | 10 +- .../Core/Infer/Inferrer.cs | 4 + .../Core/Infer/JoinField.cs | 4 + .../Core/Infer/JoinFieldConverter.cs | 8 + .../Core/Infer/JoinFieldRouting/Routing.cs | 4 + .../JoinFieldRouting/RoutingConverter.cs | 8 + .../Core/Infer/Metric/Metrics.cs | 4 + .../Core/Infer/PropertyMapping.cs | 8 + .../Core/Infer/PropertyName/PropertyName.cs | 10 +- .../PropertyName/PropertyNameExtensions.cs | 4 + .../Core/Infer/RelationName/RelationName.cs | 8 + .../RelationName/RelationNameResolver.cs | 4 + .../Core/Infer/RoutingResolver.cs | 4 + .../Core/Infer/Timestamp/Timestamp.cs | 4 + .../Core/IsADictionary.cs | 4 + .../Core/IsAReadOnlyDictionary.cs | 4 + .../Core/LazyJson.cs | 8 + .../Core/MinimumShouldMatch.cs | 4 + .../Core/OpenTelemetry/SemanticConventions.cs | 4 + .../Core/RawJsonString.cs | 4 + .../Core/ReadOnlyFieldDictionary.cs | 4 + .../Core/ReadOnlyIndexNameDictionary.cs | 4 + .../Core/Request/ApiUrls.cs | 4 + .../Core/Request/PlainRequest.cs | 4 + .../Core/Request/Request.cs | 8 +- .../Core/Request/RequestDescriptor.cs | 8 + .../Core/Request/RouteValues.cs | 4 + .../Core/Request/UrlLookup.cs | 4 + .../Core/Response/DictionaryResponse.cs | 4 + .../Response/ResolvableDictionaryProxy.cs | 4 + .../Core/Static/Infer.cs | 8 + .../Core/Union/Union.cs | 4 + .../DataStreamNames/DataStreamName.cs | 4 + .../DataStreamNames/DataStreamNames.cs | 4 + .../UrlParameters/IndexAlias/IndexAlias.cs | 4 + .../Core/UrlParameters/IndexUuid/IndexUuid.cs | 4 + .../Core/UrlParameters/Name/Name.cs | 8 + .../Core/UrlParameters/Name/Names.cs | 4 + .../Core/UrlParameters/NodeIds/NodeIds.cs | 4 + .../Core/UrlParameters/ScrollIds/ScrollId.cs | 4 + .../Core/UrlParameters/ScrollIds/ScrollIds.cs | 4 + .../Core/UrlParameters/TaskId/TaskId.cs | 8 + .../Core/UrlParameters/Username/Username.cs | 8 + .../CrossPlatform/IsExternalInit.cs | 0 .../CrossPlatform/NativeMethods.cs | 4 + .../CrossPlatform/NullableAttributes.cs | 0 .../CrossPlatform/RuntimeInformation.cs | 4 + .../CrossPlatform/TypeExtensions.cs | 4 + ...tic.Clients.Elasticsearch.Shared.projitems | 14 + ...lastic.Clients.Elasticsearch.Shared.shproj | 13 + .../Exceptions/UnsupportedProductException.cs | 4 + .../AggregateDictionaryExtensions.cs | 8 + .../Helpers/BlockingSubscribeExtensions.cs | 4 +- .../Helpers/BulkAllObservable.cs | 299 ++ .../Helpers/BulkAllObserver.cs | 4 + .../Helpers/BulkAllRequest.cs | 12 + .../Helpers/BulkAllResponse.cs | 8 + .../Helpers/CoordinatedRequestDefaults.cs | 4 + .../Helpers/CoordinatedRequestObserverBase.cs | 4 + .../Helpers/HelperIdentifiers.cs | 4 + .../Helpers/IBulkAllRequest.cs | 8 + .../Helpers/IHelperCallable.cs | 4 + .../Helpers/PartitionHelper.cs | 4 + .../Helpers/ProducerConsumerBackPressure.cs | 4 + .../Helpers/RequestMetaDataExtensions.cs | 4 + .../Helpers/RequestMetaDataFactory.cs | 4 + .../Helpers/RequestParametersExtensions.cs | 4 + .../AggregationSerializationHelper.cs | 8 + .../CustomJsonWriterConverter.cs | 4 + .../CustomJsonWriterConverterFactory.cs | 4 + .../Serialization/CustomizedNamingPolicy.cs | 4 + .../DefaultRequestResponseSerializer.cs | 6 +- .../Serialization/DefaultSourceSerializer.cs | 6 +- .../DictionaryResponseConverter.cs | 4 + .../DoubleWithFractionalPortionConverter.cs | 4 + .../Serialization/EnumStructConverter.cs | 8 + .../GenericConverterAttribute.cs | 4 + .../Serialization/ICustomJsonWriter.cs | 6 +- .../Serialization/ISourceMarker.cs | 4 + .../Serialization/IStreamSerializable.cs | 4 + .../Serialization/IUnionVerifiable.cs | 4 + .../Serialization/InterfaceConverter.cs | 4 + .../InterfaceConverterAttribute.cs | 4 + .../IntermediateSourceConverter.cs | 4 + .../IsADictionaryConverterFactory.cs | 8 + .../Serialization/JsonConstants.cs | 4 + .../Serialization/JsonHelper.cs | 4 + .../JsonSerializerOptionsExtensions.cs | 4 + .../Serialization/KeyValuePairConverter.cs | 6 +- .../Serialization/MultiItemUnionConverter.cs | 10 +- .../Serialization/NumericAliasConverter.cs | 4 + .../ObjectToInferredTypesConverter.cs | 4 + .../Serialization/PropertyNameConverter.cs | 4 + .../Serialization/QueryConverter.cs | 4 + .../ReadOnlyFieldDictionaryConverter.cs | 4 + .../ReadOnlyIndexNameDictionaryConverter.cs | 4 + ...vableReadonlyDictionaryConverterFactory.cs | 4 + .../ResponseItemConverterFactory.cs | 12 + .../Serialization/SelfSerializable.cs | 4 + .../SelfSerializableConverterFactory.cs | 4 + .../Serialization/SerializationConstants.cs | 4 + .../Serialization/SerializerExtensions.cs | 4 + .../Serialization/SettingsJsonConverter.cs | 4 + .../Serialization/SimpleInterfaceConverter.cs | 4 + .../SingleOrManyCollectionAttribute.cs | 4 + .../SingleOrManyCollectionConverter.cs | 6 +- .../SingleOrManySerializationHelper.cs | 4 + .../SingleWithFractionalPortionConverter.cs | 4 + .../Serialization/SourceConverter.cs | 4 + .../Serialization/SourceConverterAttribute.cs | 4 + .../Serialization/SourceConverterFactory.cs | 4 + .../Serialization/SourceMarker.cs | 4 + .../Serialization/SourceSerialization.cs | 4 + .../Serialization/StringAliasConverter.cs | 4 + .../Serialization/StringEnumAttribute.cs | 4 + .../Serialization/Stringified.cs | 6 +- .../Serialization/SystemTextJsonSerializer.cs | 8 +- .../TermsAggregateSerializationHelper.cs | 8 + .../Serialization/UnionConverter.cs | 8 + .../AggregateDictionaryConverter.cs | 8 + .../Types/Aggregations/AggregateOrder.cs | 4 + .../Types/Aggregations/Aggregation.cs | 4 + .../Aggregations/AggregationDescriptor.cs | 4 + .../Types/Aggregations/TermsAggregate.cs | 4 + .../TermsAggregationDescriptor.cs | 4 + .../Types/Aggregations/TermsBucket.cs | 4 + .../Types/Aggregations/TermsExclude.cs | 6 +- .../Types/Aggregations/TermsInclude.cs | 4 + .../Types/AsyncSearch/AsyncSearch.cs | 4 + .../Types/Core/Bulk/BulkCreateOperation.cs | 8 + .../Bulk/BulkCreateOperationDescriptor.cs | 12 + .../Types/Core/Bulk/BulkDeleteOperation.cs | 8 + .../Bulk/BulkDeleteOperationDescriptor.cs | 8 + .../Types/Core/Bulk/BulkIndexOperation.cs | 8 + .../Core/Bulk/BulkIndexOperationDescriptor.cs | 14 +- .../Types/Core/Bulk/BulkOperation.cs | 10 +- .../Core/Bulk/BulkOperationDescriptor.cs | 12 + .../Core/Bulk/BulkOperationsCollection.cs | 8 + .../Core/Bulk/BulkResponseItemConverter.cs | 4 + .../Types/Core/Bulk/BulkUpdateBody.cs | 12 + .../Types/Core/Bulk/BulkUpdateOperation.cs | 8 + .../Bulk/BulkUpdateOperationDescriptor.cs | 12 + .../Types/Core/Bulk/BulkUpdateOperationT.cs | 8 + .../Bulk/BulkUpdateOperationWithPartial.cs | 4 + .../Bulk/BulkUpdateOperationWithScript.cs | 4 + .../Types/Core/Bulk/IBulkOperation.cs | 4 + .../Types/Core/Bulk/PartialBulkUpdateBody.cs | 8 + .../Bulk/Response/BulkCreateResponseItem.cs | 4 + .../Bulk/Response/BulkDeleteResponseItem.cs | 4 + .../Bulk/Response/BulkIndexResponseItem.cs | 4 + .../Bulk/Response/BulkUpdateResponseItem.cs | 4 + .../Types/Core/Bulk/ScriptedBulkUpdateBody.cs | 8 + .../Types/Core/MSearch/SearchRequestItem.cs | 10 +- .../SearchTemplateRequestItem.cs | 12 + .../Types/Core/Search/SuggestDictionary.cs | 8 + .../Types/FieldSort.cs | 8 + .../Types/GeoLocation.cs | 4 + .../Types/Mapping/Properties.cs | 8 + .../Types/Mapping/PropertiesDescriptor.cs | 8 + .../Types/Mapping/PropertyNameExtensions.cs | 4 + .../Types/MultiSearchItem.cs | 4 + .../Types/OpType.cs | 4 + .../Types/PointInTimeReferenceDescriptor.cs | 4 + .../Types/QueryDsl/BoolQuery.cs | 4 + .../Types/QueryDsl/BoolQueryAndExtensions.cs | 4 + .../Types/QueryDsl/BoolQueryExtensions.cs | 4 + .../Types/QueryDsl/BoolQueryOrExtensions.cs | 6 +- .../Types/QueryDsl/FunctionScore.cs | 4 + .../Types/QueryDsl/Query.cs | 4 + .../Types/QueryDsl/QueryDescriptor.cs | 4 + .../Types/QueryDsl/RangeQuery.cs | 8 + .../Types/QueryDsl/RawJsonQuery.cs | 4 + .../Types/QueryDsl/SearchQuery.cs | 4 + .../Types/Ranges.cs | 4 + .../Types/Refresh.cs | 4 + .../Types/Scripting/InlineScript.cs | 8 + .../Types/Scripting/Script.cs | 4 + .../Types/SortOptions.cs | 8 + .../Types/SourceConfig.cs | 4 + .../Types/Sql/SqlRow.cs | 4 + .../Types/Sql/SqlValue.cs | 4 + .../Types/StoredScriptId.cs | 4 + .../Types/WaitForActiveShards.cs | 4 + .../Elastic.Clients.Elasticsearch.csproj | 4 + .../Helpers/BulkAllObservable.cs | 296 -- .../ElasticsearchClient.AsyncSearch.g.cs | 80 +- .../Client/ElasticsearchClient.Cluster.g.cs | 88 +- .../Client/ElasticsearchClient.Enrich.g.cs | 36 +- .../Client/ElasticsearchClient.Eql.g.cs | 40 +- .../Client/ElasticsearchClient.Graph.g.cs | 24 +- .../Client/ElasticsearchClient.Indices.g.cs | 160 +- .../Client/ElasticsearchClient.Ingest.g.cs | 52 +- .../Client/ElasticsearchClient.Tasks.g.cs | 48 +- .../Client/ElasticsearchClient.g.cs | 76 +- src/Playground/Playground.csproj | 4 +- src/Playground/packages.lock.json | 17 +- tests/Tests/Tests.csproj | 2 +- tests/Tests/packages.lock.json | 8 +- 1246 files changed, 215486 insertions(+), 642 deletions(-) create mode 100644 release.bat create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregationRange.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ArrayPercentilesItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeExpression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrMethod.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceClassImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomNormalizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseNormalizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkIndexByScrollFailure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationDecision.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationStore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterFileSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndices.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShards.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIngest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmVersion.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodeCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcess.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessCpu.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterShardMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CurrentNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/DiskUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypesMappings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexHealthStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemorySummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndicesVersions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeDiskUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodePackagingType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/PendingTask.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ReservedSize.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ShardHealthStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/UnassignedInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CompletionStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CoordsGeoBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Bulk/ResponseItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/Explanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/ExplanationDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Get/GetResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetError.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetOperation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchBody.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/DocumentRating.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/UnratedDocument.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationBreakdown.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Collector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionContext.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggester.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/DirectGenerator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileDebug.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldCollapse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldSuggester.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Highlight.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HighlightField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Hit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HitsMetadata.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHitsResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/NestedIdentity.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggester.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PointInTimeReference.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Profile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryBreakdown.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryProfile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RegexOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Rescore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RescoreQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SearchProfile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/ShardProfile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SmoothingModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SourceFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestFuzziness.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Suggester.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggester.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TotalHits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Filter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Term.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/TermVector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Token.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/DocStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ElasticsearchVersionInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CacheStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CoordinatorStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecutingPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Aggregations.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Analysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Cluster.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.Search.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Enrich.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.IndexManagement.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.NoNamespace.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Watcher.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldMemoryUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSizeUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FielddataStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FlushStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLine.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GetStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Connection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Vertex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexInclude.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AliasDefinition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CacheQueries.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseIndexResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseShardResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleExplain.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleWithRollover.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DlmRolloverConditions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAliases.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Overlapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RetentionLease.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SearchIdle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsHighlight.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardCommit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardLease.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardPath.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardQueryCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRouting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Storage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Template.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TemplateMapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogRetention.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexingStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Document.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LatLonGeoLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AllField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DataStreamTimestamp.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldNamesField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IndexField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RoutingField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SizeField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SourceField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MergesStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NodeStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/PluginStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryCacheStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedDoc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RecoveryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RefreshStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RequestCacheStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Retries.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScoreSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SearchStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardFailure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SortOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoreStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScript.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TranslogStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WarmerStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WktGeoBounds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/AsyncSearch/GetAsyncSearchRequest.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/AsyncSearch/SubmitAsyncSearchRequest.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/BulkRequest.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/BulkResponse.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/CountRequest.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/CreateRequest.cs (80%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/DeleteRequest.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/Eql/EqlGetResponse.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/ExistsRequest.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/GetSourceRequestDescriptor.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/GetSourceResponse.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexManagement/GetAliasResponse.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexManagement/GetFieldMappingResponse.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexManagement/GetIndexResponse.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexManagement/GetMappingResponse.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexManagement/GetTemplateResponse.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/IndexRequest.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/Ingest/GetPipelineResponse.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/Ingest/Processor.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/MultiSearchRequest.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/ResponseItem.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/ScrollResponse.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/SearchRequest.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/SearchResponse.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/Sql/GetAsyncResponse.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Api/Sql/QueryResponse.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/ElasticsearchClient-BulkAll.cs (59%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/ElasticsearchClient-Manual.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/ElasticsearchResponseBaseExtensions.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/IndexManyExtensions.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/IndicesNamespace.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Client/NamespacedClientProxy.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Aggregations/AggregationCombinator.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Aggregations/AggregationDictionary.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Aggregations/IAggregate.cs (73%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Aggregations/SearchAggregation.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Configuration/ClrTypeDefaults.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Configuration/ElasticsearchClientSettings.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Configuration/IElasticsearchClientSettings.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Configuration/MemberInfoResolver.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/DateMath/DateMath.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/DateMath/DateMathExpression.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/DateMath/DateMathOperation.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/DateMath/DateMathTime.cs (99%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/DateMath/DateMathTimeUnit.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/Duration.cs (99%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/DateTime/TimeUnit.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/EmptyReadOnly.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/EmptyReadOnlyExtensions.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Exceptions/ThrowHelper.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/ExceptionExtensions.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/ExpressionExtensions.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/Extensions.cs (99%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/StringExtensions.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/SuffixExtensions.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/TaskExtensions.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Extensions/TypeExtensions.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fields/FieldValue.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fields/FieldValues.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/Descriptor.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/Fluent.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/FluentDictionary.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/IBuildableDescriptor.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/Promise/IPromise.cs (77%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/Promise/IsADictionaryDescriptor.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Fluent/Promise/PromiseDescriptor.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/IComplexUnion.cs (80%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/IEnumStruct.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/DefaultPropertyMappingProvider.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/DocumentPath/DocumentPath.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/Field.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/FieldConverter.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/FieldExpressionVisitor.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/FieldExtensions.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/FieldResolver.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Field/ToStringExpressionVisitor.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Fields/Fields.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Fields/FieldsConverter.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Fields/FieldsDescriptor.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/IPropertyMappingProvider.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/Id.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/IdConverter.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/IdExtensions.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/IdResolver.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/Ids.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Id/IdsConverter.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/IndexName/IndexName.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/IndexName/IndexNameConverter.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/IndexName/IndexNameExtensions.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/IndexName/IndexNameResolver.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Indices/Indices.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Inferrer.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/JoinField.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/JoinFieldConverter.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/JoinFieldRouting/Routing.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/JoinFieldRouting/RoutingConverter.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Metric/Metrics.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/PropertyMapping.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/PropertyName/PropertyName.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/PropertyName/PropertyNameExtensions.cs (83%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/RelationName/RelationName.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/RelationName/RelationNameResolver.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/RoutingResolver.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Infer/Timestamp/Timestamp.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/IsADictionary.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/IsAReadOnlyDictionary.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/LazyJson.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/MinimumShouldMatch.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/OpenTelemetry/SemanticConventions.cs (76%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/RawJsonString.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/ReadOnlyFieldDictionary.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/ReadOnlyIndexNameDictionary.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/ApiUrls.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/PlainRequest.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/Request.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/RequestDescriptor.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/RouteValues.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Request/UrlLookup.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Response/DictionaryResponse.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Response/ResolvableDictionaryProxy.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Static/Infer.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/Union/Union.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/DataStreamNames/DataStreamName.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/DataStreamNames/DataStreamNames.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/IndexAlias/IndexAlias.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/IndexUuid/IndexUuid.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/Name/Name.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/Name/Names.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/NodeIds/NodeIds.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/ScrollIds/ScrollId.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/ScrollIds/ScrollIds.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/TaskId/TaskId.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Core/UrlParameters/Username/Username.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/CrossPlatform/IsExternalInit.cs (100%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/CrossPlatform/NativeMethods.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/CrossPlatform/NullableAttributes.cs (100%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/CrossPlatform/RuntimeInformation.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/CrossPlatform/TypeExtensions.cs (90%) create mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.projitems create mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.shproj rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Exceptions/UnsupportedProductException.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Experimental/AggregateDictionaryExtensions.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/BlockingSubscribeExtensions.cs (97%) create mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObservable.cs rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/BulkAllObserver.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/BulkAllRequest.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/BulkAllResponse.cs (79%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/CoordinatedRequestDefaults.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/CoordinatedRequestObserverBase.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/HelperIdentifiers.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/IBulkAllRequest.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/IHelperCallable.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/PartitionHelper.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/ProducerConsumerBackPressure.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/RequestMetaDataExtensions.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/RequestMetaDataFactory.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Helpers/RequestParametersExtensions.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/AggregationSerializationHelper.cs (83%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/CustomJsonWriterConverter.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/CustomJsonWriterConverterFactory.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/CustomizedNamingPolicy.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/DefaultRequestResponseSerializer.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/DefaultSourceSerializer.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/DictionaryResponseConverter.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/DoubleWithFractionalPortionConverter.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/EnumStructConverter.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/GenericConverterAttribute.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ICustomJsonWriter.cs (79%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ISourceMarker.cs (73%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/IStreamSerializable.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/IUnionVerifiable.cs (75%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/InterfaceConverter.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/InterfaceConverterAttribute.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/IntermediateSourceConverter.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/IsADictionaryConverterFactory.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/JsonConstants.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/JsonHelper.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/JsonSerializerOptionsExtensions.cs (83%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/KeyValuePairConverter.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/MultiItemUnionConverter.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/NumericAliasConverter.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ObjectToInferredTypesConverter.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/PropertyNameConverter.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/QueryConverter.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ReadOnlyFieldDictionaryConverter.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ReadOnlyIndexNameDictionaryConverter.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/ResponseItemConverterFactory.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SelfSerializable.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SelfSerializableConverterFactory.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SerializationConstants.cs (76%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SerializerExtensions.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SettingsJsonConverter.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SimpleInterfaceConverter.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SingleOrManyCollectionAttribute.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SingleOrManyCollectionConverter.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SingleOrManySerializationHelper.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SingleWithFractionalPortionConverter.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SourceConverter.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SourceConverterAttribute.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SourceConverterFactory.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SourceMarker.cs (75%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SourceSerialization.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/StringAliasConverter.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/StringEnumAttribute.cs (78%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/Stringified.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/SystemTextJsonSerializer.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/TermsAggregateSerializationHelper.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Serialization/UnionConverter.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/AggregateDictionaryConverter.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/AggregateOrder.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/Aggregation.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/AggregationDescriptor.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/TermsAggregate.cs (88%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/TermsAggregationDescriptor.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/TermsBucket.cs (87%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/TermsExclude.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Aggregations/TermsInclude.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/AsyncSearch/AsyncSearch.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkCreateOperation.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkCreateOperationDescriptor.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkDeleteOperation.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkIndexOperation.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkIndexOperationDescriptor.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkOperation.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkOperationDescriptor.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkOperationsCollection.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkResponseItemConverter.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateBody.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateOperation.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateOperationT.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/BulkUpdateOperationWithScript.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/IBulkOperation.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/PartialBulkUpdateBody.cs (81%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/Response/BulkCreateResponseItem.cs (77%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs (77%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/Response/BulkIndexResponseItem.cs (77%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs (77%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Bulk/ScriptedBulkUpdateBody.cs (85%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/MSearch/SearchRequestItem.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs (84%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Core/Search/SuggestDictionary.cs (96%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/FieldSort.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/GeoLocation.cs (83%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Mapping/Properties.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Mapping/PropertiesDescriptor.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Mapping/PropertyNameExtensions.cs (82%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/MultiSearchItem.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/OpType.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/PointInTimeReferenceDescriptor.cs (78%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/BoolQuery.cs (79%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/BoolQueryAndExtensions.cs (98%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/BoolQueryExtensions.cs (90%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/BoolQueryOrExtensions.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/FunctionScore.cs (89%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/Query.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/QueryDescriptor.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/RangeQuery.cs (97%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/RawJsonQuery.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/QueryDsl/SearchQuery.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Ranges.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Refresh.cs (86%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Scripting/InlineScript.cs (92%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Scripting/Script.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/SortOptions.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/SourceConfig.cs (94%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Sql/SqlRow.cs (93%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/Sql/SqlValue.cs (91%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/StoredScriptId.cs (95%) rename src/{Elastic.Clients.Elasticsearch => Elastic.Clients.Elasticsearch.Shared}/Types/WaitForActiveShards.cs (88%) delete mode 100644 src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs diff --git a/Elasticsearch.sln b/Elasticsearch.sln index 06d9e0d6360..c6feca48733 100644 --- a/Elasticsearch.sln +++ b/Elasticsearch.sln @@ -55,6 +55,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.ClusterLauncher", "te EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Clients.Elasticsearch.JsonNetSerializer", "src\Elastic.Clients.Elasticsearch.JsonNetSerializer\Elastic.Clients.Elasticsearch.JsonNetSerializer.csproj", "{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Clients.Elasticsearch.Serverless", "src\Elastic.Clients.Elasticsearch.Serverless\Elastic.Clients.Elasticsearch.Serverless.csproj", "{49D7F5A7-AA32-492B-B957-0E3325861F55}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Elastic.Clients.Elasticsearch.Shared", "src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.shproj", "{A90DD7B8-8AFB-4BE9-AA16-B159A880E79D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -209,6 +213,18 @@ Global {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x64.Build.0 = Release|Any CPU {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x86.ActiveCfg = Release|Any CPU {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x86.Build.0 = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x64.ActiveCfg = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x64.Build.0 = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x86.ActiveCfg = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x86.Build.0 = Debug|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|Any CPU.Build.0 = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x64.ActiveCfg = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x64.Build.0 = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x86.ActiveCfg = Release|Any CPU + {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -226,8 +242,15 @@ Global {68D1BFDC-F447-4D2C-AF81-537807636610} = {1FE49D14-216A-41EE-A177-E42BFF53E0DC} {F6162603-D134-4121-8106-2BA4DAD7350B} = {362B2776-4B29-46AB-B237-56776B5372B6} {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7} + {49D7F5A7-AA32-492B-B957-0E3325861F55} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7} + {A90DD7B8-8AFB-4BE9-AA16-B159A880E79D} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CE74F821-B001-4C69-A58D-CF81F8B0B632} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{49d7f5a7-aa32-492b-b957-0e3325861f55}*SharedItemsImports = 5 + src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{a90dd7b8-8afb-4be9-aa16-b159a880e79d}*SharedItemsImports = 13 + src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{f8a7e60c-0c48-4d76-af7f-7881df5a263d}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/release.bat b/release.bat new file mode 100644 index 00000000000..82a6684e6a5 --- /dev/null +++ b/release.bat @@ -0,0 +1 @@ +dotnet pack -c Release -o build/output /p:CurrentVersion=1.0.0-preview.1+20231031;CurrentAssemblyVersion=1.0.0;CurrentAssemblyFileVersion=1.0.0 \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs new file mode 100644 index 00000000000..d32e24670be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs @@ -0,0 +1,334 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Transport; +using Elastic.Transport.Diagnostics; +using Elastic.Transport.Products.Elasticsearch; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// A strongly-typed client for communicating with Elasticsearch server endpoints. +/// +public partial class ElasticsearchClient +{ + private const string OpenTelemetrySpanAttributePrefix = "db.elasticsearch."; + // This should be updated if any of the code uses semantic conventions defined in newer schema versions. + private const string OpenTelemetrySchemaVersion = "https://opentelemetry.io/schemas/1.21.0"; + + private readonly HttpTransport _transport; + internal static ConditionalWeakTable SettingsTable { get; } = new(); + + /// + /// Creates a client configured to connect to http://localhost:9200. + /// + public ElasticsearchClient() : this(new ElasticsearchClientSettings(new Uri("http://localhost:9200"))) { } + + /// + /// Creates a client configured to connect to a node reachable at the provided . + /// + /// The to connect to. + public ElasticsearchClient(Uri uri) : this(new ElasticsearchClientSettings(uri)) { } + + /// + /// Creates a client configured to communicate with Elastic Cloud using the provided . + /// See the documentation for more information on how to obtain your Cloud Id. + /// + /// If you want more control, use the constructor and + /// pass an instance of that takes a in its constructor as well. + /// + /// + /// The Cloud ID of an Elastic Cloud deployment. + /// The credentials to use for the connection. + public ElasticsearchClient(string cloudId, AuthorizationHeader credentials) : this( + new ElasticsearchClientSettings(cloudId, credentials)) + { + } + + /// + /// Creates a client using the provided configuration to initialise the client. + /// + /// The used to configure the client. + public ElasticsearchClient(IElasticsearchClientSettings elasticsearchClientSettings) + : this(new DefaultHttpTransport(elasticsearchClientSettings)) + { + } + + internal ElasticsearchClient(HttpTransport transport) + { + transport.ThrowIfNull(nameof(transport)); + transport.Settings.ThrowIfNull(nameof(transport.Settings)); + transport.Settings.RequestResponseSerializer.ThrowIfNull( + nameof(transport.Settings.RequestResponseSerializer)); + transport.Settings.Inferrer.ThrowIfNull(nameof(transport.Settings.Inferrer)); + + _transport = transport; + + SetupNamespaces(); + } + + public IElasticsearchClientSettings ElasticsearchClientSettings => _transport.Settings; + public Inferrer Infer => _transport.Settings.Inferrer; + public Serializer RequestResponseSerializer => _transport.Settings.RequestResponseSerializer; + public Serializer SourceSerializer => _transport.Settings.SourceSerializer; + public HttpTransport Transport => _transport; + + private ProductCheckStatus _productCheckStatus; + + private enum ProductCheckStatus + { + NotChecked, + Succeeded, + Failed + } + + private partial void SetupNamespaces(); + + internal TResponse DoRequest(TRequest request) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + where TRequestParameters : RequestParameters, new() => + DoRequest(request, null); + + internal TResponse DoRequest( + TRequest request, + Action? forceConfiguration) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + where TRequestParameters : RequestParameters, new() + => DoRequestCoreAsync(false, request, forceConfiguration).EnsureCompleted(); + + internal Task DoRequestAsync( + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + where TRequestParameters : RequestParameters, new() + => DoRequestAsync(request, null, cancellationToken); + + internal Task DoRequestAsync( + TRequest request, + Action? forceConfiguration, + CancellationToken cancellationToken = default) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + where TRequestParameters : RequestParameters, new() + => DoRequestCoreAsync(true, request, forceConfiguration, cancellationToken).AsTask(); + + private ValueTask DoRequestCoreAsync( + bool isAsync, + TRequest request, + Action? forceConfiguration, + CancellationToken cancellationToken = default) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + where TRequestParameters : RequestParameters, new() + { + if (_productCheckStatus == ProductCheckStatus.Failed) + throw new UnsupportedProductException(UnsupportedProductException.InvalidProductError); + + var (requestModified, hadRequestConfig, originalHeaders) = AttachProductCheckHeaderIfRequired(request); + var (resolvedUrl, urlTemplate, resolvedRouteValues, postData) = PrepareRequest(request, forceConfiguration); + var openTelemetryData = PrepareOpenTelemetryData(request, resolvedRouteValues); + + if (_productCheckStatus == ProductCheckStatus.Succeeded && !requestModified) + { + if (isAsync) + return new ValueTask(_transport.RequestAsync(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData, cancellationToken)); + else + return new ValueTask(_transport.Request(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData)); + } + + return SendRequest(isAsync); + + async ValueTask SendRequest(bool isAsync) + { + TResponse response; + + if (isAsync) + response = await _transport.RequestAsync(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData, cancellationToken).ConfigureAwait(false); + else + response = _transport.Request(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData); + + PostRequestProductCheck(request, response); + + if (_productCheckStatus == ProductCheckStatus.Failed) + throw new UnsupportedProductException(UnsupportedProductException.InvalidProductError); + + if (request.RequestParameters.RequestConfiguration is not null) + { + if (!hadRequestConfig) + { + request.RequestParameters.RequestConfiguration = null; + } + else if (originalHeaders.HasValue && originalHeaders.Value.Count > 0) + { + request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = originalHeaders.Value; + } + } + + return response; + } + } + + private static OpenTelemetryData PrepareOpenTelemetryData(TRequest request, Dictionary resolvedRouteValues) + where TRequest : Request + where TRequestParameters : RequestParameters, new() + { + // If there are no subscribed listeners, we avoid some work and allocations + if (!Elastic.Transport.Diagnostics.OpenTelemetry.ElasticTransportActivitySourceHasListeners) + return default; + + // We fall back to a general operation name in cases where the derived request fails to override the property + var operationName = !string.IsNullOrEmpty(request.OperationName) ? request.OperationName : request.HttpMethod.GetStringValue(); + + // TODO: Optimisation: We should consider caching these, either for cases where resolvedRouteValues is null, or + // caching per combination of route values. + // We should benchmark this first to assess the impact for common workloads. + // The former is likely going to save some short-lived allocations, but only for requests to endpoints without required path parts. + // The latter may bloat the cache as some combinations of path parts may rarely re-occur. + var attributes = new Dictionary + { + [OpenTelemetry.SemanticConventions.DbOperation] = !string.IsNullOrEmpty(request.OperationName) ? request.OperationName : "unknown", + [$"{OpenTelemetrySpanAttributePrefix}schema_url"] = OpenTelemetrySchemaVersion + }; + + if (resolvedRouteValues is not null) + { + foreach (var value in resolvedRouteValues) + { + if (!string.IsNullOrEmpty(value.Key) && !string.IsNullOrEmpty(value.Value)) + attributes.Add($"{OpenTelemetrySpanAttributePrefix}path_parts.{value.Key}", value.Value); + } + } + + var openTelemetryData = new OpenTelemetryData { SpanName = operationName, SpanAttributes = attributes }; + return openTelemetryData; + } + + private (bool requestModified, bool hadRequestConfig, HeadersList? originalHeaders) AttachProductCheckHeaderIfRequired(TRequest request) + where TRequest : Request + where TRequestParameters : RequestParameters, new() + { + var requestModified = false; + var hadRequestConfig = false; + HeadersList? originalHeaders = null; + + // If we have not yet checked the product name, add the product header to the list of headers to parse. + if (_productCheckStatus == ProductCheckStatus.NotChecked) + { + requestModified = true; + + if (request.RequestParameters.RequestConfiguration is null) + { + request.RequestParameters.RequestConfiguration = new RequestConfiguration(); + } + else + { + originalHeaders = request.RequestParameters.RequestConfiguration.ResponseHeadersToParse; + hadRequestConfig = true; + } + + if (request.RequestParameters.RequestConfiguration.ResponseHeadersToParse.Count == 0) + { + request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = new HeadersList("x-elastic-product"); + } + else + { + request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = new HeadersList(request.RequestParameters.RequestConfiguration.ResponseHeadersToParse, "x-elastic-product"); + } + } + + return (requestModified, hadRequestConfig, originalHeaders); + } + + private (string resolvedUrl, string urlTemplate, Dictionary? resolvedRouteValues, PostData data) PrepareRequest(TRequest request, + Action? forceConfiguration) + where TRequest : Request + where TRequestParameters : RequestParameters, new() + { + request.ThrowIfNull(nameof(request), "A request is required."); + + if (forceConfiguration is not null) + ForceConfiguration(request, forceConfiguration); + + if (request.ContentType is not null) + ForceContentType(request, request.ContentType); + + if (request.Accept is not null) + ForceAccept(request, request.Accept); + + var (resolvedUrl, urlTemplate, routeValues) = request.GetUrl(ElasticsearchClientSettings); + + var postData = + request.HttpMethod == HttpMethod.GET || + request.HttpMethod == HttpMethod.HEAD || !request.SupportsBody + ? null + : PostData.Serializable(request); + + return (resolvedUrl, urlTemplate, routeValues, postData); + } + + private void PostRequestProductCheck(TRequest request, TResponse response) + where TRequest : Request + where TResponse : ElasticsearchResponse, new() + { + if (response.ApiCallDetails.HttpStatusCode.HasValue && response.ApiCallDetails.HttpStatusCode.Value >= 200 && response.ApiCallDetails.HttpStatusCode.Value <= 299 && _productCheckStatus == ProductCheckStatus.NotChecked) + { + if (!response.ApiCallDetails.TryGetHeader("x-elastic-product", out var values) || !values.Single().Equals("Elasticsearch", StringComparison.Ordinal)) + { + _productCheckStatus = ProductCheckStatus.Failed; + } + + _productCheckStatus = ProductCheckStatus.Succeeded; + } + } + + private static void ForceConfiguration(Request request, Action forceConfiguration) + where TRequestParameters : RequestParameters, new() + { + var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration(); + forceConfiguration(configuration); + request.RequestParameters.RequestConfiguration = configuration; + } + + private static void ForceContentType(TRequest request, string contentType) + where TRequest : Request + where TRequestParameters : RequestParameters, new() + { + var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration(); + configuration.Accept = contentType; + configuration.ContentType = contentType; + request.RequestParameters.RequestConfiguration = configuration; + } + + private static void ForceAccept(TRequest request, string acceptType) + where TRequest : Request + where TRequestParameters : RequestParameters, new() + { + var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration(); + configuration.Accept = acceptType; + request.RequestParameters.RequestConfiguration = configuration; + } + + internal static void ForceJson(IRequestConfiguration requestConfiguration) + { + requestConfiguration.Accept = RequestData.DefaultMimeType; + requestConfiguration.ContentType = RequestData.DefaultMimeType; + } + + internal static void ForceTextPlain(IRequestConfiguration requestConfiguration) + { + requestConfiguration.Accept = RequestData.MimeTypeTextPlain; + requestConfiguration.ContentType = RequestData.MimeTypeTextPlain; + } +} diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs b/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs new file mode 100644 index 00000000000..a58f9af7ea9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics.CodeAnalysis; +using Elastic.Transport; +using Elastic.Transport.Products.Elasticsearch; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed class ElasticsearchClientProductRegistration : ElasticsearchProductRegistration +{ + public ElasticsearchClientProductRegistration(Type markerType) : base(markerType) { } + + public static ElasticsearchClientProductRegistration DefaultForElasticsearchClientsElasticsearch { get; } = new(typeof(ElasticsearchClient)); + + public override string ServiceIdentifier => "esv"; + + public override string DefaultMimeType => null; // Prevent base 'ElasticsearchProductRegistration' from sending the compatibility header + + /// + /// Elastic.Clients.Elasticsearch handles 404 in its , we do not want the low level client throwing + /// exceptions + /// when is enabled for 404's. The client is in charge of + /// composing paths + /// so a 404 never signals a wrong URL but a missing entity. + /// + public override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) => + statusCode is >= 200 and < 300 or 404; + + /// + /// Makes the low level transport aware of Elastic.Clients.Elasticsearch's + /// so that it can peek in to its exposed error when reporting failures. + /// + public override bool TryGetServerErrorReason(TResponse response, [NotNullWhen(returnValue: true)] out string? reason) + { + if (response is not ElasticsearchResponse r) + return base.TryGetServerErrorReason(response, out reason); + reason = r.ElasticsearchServerError?.Error?.ToString(); + return !string.IsNullOrEmpty(reason); + } +} diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj new file mode 100644 index 00000000000..9bc13018790 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj @@ -0,0 +1,44 @@ + + + Elastic.Clients.Elasticsearch.Serverless + Elastic.Clients.Elasticsearch.Serverless - Official Elasticsearch Serverless .NET Client + elasticsearch;elastic;client;search + + This strongly-typed, client library enables working with Elasticsearch Serverless. It is the official client maintained and supported by Elastic. + + true + README.md + + + $(DefineConstants);ELASTICSEARCH_SERVERLESS + + + true + true + netstandard2.0;net461;netstandard2.1;netcoreapp3.1;net5.0;net6.0 + true + true + annotations + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + <_Parameter1>true + + + + + + + \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs new file mode 100644 index 00000000000..d2b24366f4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; + +internal static class ApiUrlLookup +{ + internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "_async_search/status/{id}" }); + internal static ApiUrls AsyncSearchDelete = new ApiUrls(new[] { "_async_search/{id}" }); + internal static ApiUrls AsyncSearchGet = new ApiUrls(new[] { "_async_search/{id}" }); + internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "_async_search", "{index}/_async_search" }); + internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[] { "_bulk", "{index}/_bulk" }); + internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[] { "_search/scroll" }); + internal static ApiUrls NoNamespaceClosePointInTime = new ApiUrls(new[] { "_pit" }); + internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[] { "_cluster/allocation/explain" }); + internal static ApiUrls ClusterStats = new ApiUrls(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" }); + internal static ApiUrls ClusterGetSettings = new ApiUrls(new[] { "_cluster/settings" }); + internal static ApiUrls ClusterHealth = new ApiUrls(new[] { "_cluster/health", "_cluster/health/{index}" }); + internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[] { "_cluster/pending_tasks" }); + internal static ApiUrls NoNamespaceCount = new ApiUrls(new[] { "_count", "{index}/_count" }); + internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[] { "{index}/_create/{id}" }); + internal static ApiUrls NoNamespaceDeleteByQuery = new ApiUrls(new[] { "{index}/_delete_by_query" }); + internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[] { "{index}/_doc/{id}" }); + internal static ApiUrls NoNamespaceDeleteScript = new ApiUrls(new[] { "_scripts/{id}" }); + internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "_enrich/policy/{name}" }); + internal static ApiUrls EnrichStats = new ApiUrls(new[] { "_enrich/_stats" }); + internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "_enrich/policy/{name}/_execute" }); + internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[] { "_enrich/policy/{name}", "_enrich/policy" }); + internal static ApiUrls EnrichPutPolicy = new ApiUrls(new[] { "_enrich/policy/{name}" }); + internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "{index}/_doc/{id}" }); + internal static ApiUrls NoNamespaceExistsSource = new ApiUrls(new[] { "{index}/_source/{id}" }); + internal static ApiUrls NoNamespaceFieldCaps = new ApiUrls(new[] { "_field_caps", "{index}/_field_caps" }); + internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "{index}/_doc/{id}" }); + internal static ApiUrls NoNamespaceGetScript = new ApiUrls(new[] { "_scripts/{id}" }); + internal static ApiUrls NoNamespaceGetSource = new ApiUrls(new[] { "{index}/_source/{id}" }); + internal static ApiUrls GraphExplore = new ApiUrls(new[] { "{index}/_graph/explore" }); + internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "{index}/_close" }); + internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "_data_stream/{name}" }); + internal static ApiUrls IndexManagementCreate = new ApiUrls(new[] { "{index}" }); + internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementDeleteDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" }); + internal static ApiUrls IndexManagementDeleteDataStream = new ApiUrls(new[] { "_data_stream/{name}" }); + internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "{index}" }); + internal static ApiUrls IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); + internal static ApiUrls IndexManagementDeleteTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementExistsAlias = new ApiUrls(new[] { "_alias/{name}", "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementExistsIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); + internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "{index}" }); + internal static ApiUrls IndexManagementExistsTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementExplainDataLifecycle = new ApiUrls(new[] { "{index}/_lifecycle/explain" }); + internal static ApiUrls IndexManagementGetAlias = new ApiUrls(new[] { "_alias", "_alias/{name}", "{index}/_alias/{name}", "{index}/_alias" }); + internal static ApiUrls IndexManagementGetDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" }); + internal static ApiUrls IndexManagementGetDataStream = new ApiUrls(new[] { "_data_stream", "_data_stream/{name}" }); + internal static ApiUrls IndexManagementGet = new ApiUrls(new[] { "{index}" }); + internal static ApiUrls IndexManagementGetIndexTemplate = new ApiUrls(new[] { "_index_template", "_index_template/{name}" }); + internal static ApiUrls IndexManagementGetMapping = new ApiUrls(new[] { "_mapping", "{index}/_mapping" }); + internal static ApiUrls IndexManagementGetTemplate = new ApiUrls(new[] { "_template", "_template/{name}" }); + internal static ApiUrls IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" }); + internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "_data_stream/_migrate/{name}" }); + internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "{index}/_open" }); + internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementPutDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" }); + internal static ApiUrls IndexManagementPutIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); + internal static ApiUrls IndexManagementPutMapping = new ApiUrls(new[] { "{index}/_mapping" }); + internal static ApiUrls IndexManagementPutTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementRollover = new ApiUrls(new[] { "{alias}/_rollover", "{alias}/_rollover/{new_index}" }); + internal static ApiUrls IndexManagementSimulateIndexTemplate = new ApiUrls(new[] { "_index_template/_simulate_index/{name}" }); + internal static ApiUrls IndexManagementSimulateTemplate = new ApiUrls(new[] { "_index_template/_simulate", "_index_template/_simulate/{name}" }); + internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" }); + internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[] { "{index}/_doc/{id}", "{index}/_doc" }); + internal static ApiUrls NoNamespaceInfo = new ApiUrls(new[] { "" }); + internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); + internal static ApiUrls IngestGeoIpStats = new ApiUrls(new[] { "_ingest/geoip/stats" }); + internal static ApiUrls IngestGetPipeline = new ApiUrls(new[] { "_ingest/pipeline", "_ingest/pipeline/{id}" }); + internal static ApiUrls IngestProcessorGrok = new ApiUrls(new[] { "_ingest/processor/grok" }); + internal static ApiUrls IngestPutPipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); + internal static ApiUrls IngestSimulate = new ApiUrls(new[] { "_ingest/pipeline/_simulate", "_ingest/pipeline/{id}/_simulate" }); + internal static ApiUrls NoNamespaceMget = new ApiUrls(new[] { "_mget", "{index}/_mget" }); + internal static ApiUrls NoNamespaceMsearch = new ApiUrls(new[] { "_msearch", "{index}/_msearch" }); + internal static ApiUrls NoNamespaceMsearchTemplate = new ApiUrls(new[] { "_msearch/template", "{index}/_msearch/template" }); + internal static ApiUrls NoNamespaceMtermvectors = new ApiUrls(new[] { "_mtermvectors", "{index}/_mtermvectors" }); + internal static ApiUrls NoNamespaceOpenPointInTime = new ApiUrls(new[] { "{index}/_pit" }); + internal static ApiUrls NoNamespacePing = new ApiUrls(new[] { "" }); + internal static ApiUrls NoNamespacePutScript = new ApiUrls(new[] { "_scripts/{id}", "_scripts/{id}/{context}" }); + internal static ApiUrls NoNamespaceRankEval = new ApiUrls(new[] { "_rank_eval", "{index}/_rank_eval" }); + internal static ApiUrls NoNamespaceRenderSearchTemplate = new ApiUrls(new[] { "_render/template", "_render/template/{id}" }); + internal static ApiUrls NoNamespaceScroll = new ApiUrls(new[] { "_search/scroll" }); + internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[] { "_search", "{index}/_search" }); + internal static ApiUrls NoNamespaceSearchTemplate = new ApiUrls(new[] { "_search/template", "{index}/_search/template" }); + internal static ApiUrls NoNamespaceTermsEnum = new ApiUrls(new[] { "{index}/_terms_enum" }); + internal static ApiUrls NoNamespaceTermvectors = new ApiUrls(new[] { "{index}/_termvectors/{id}", "{index}/_termvectors" }); + internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "{index}/_update_by_query" }); + internal static ApiUrls NoNamespaceUpdate = new ApiUrls(new[] { "{index}/_update/{id}" }); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs new file mode 100644 index 00000000000..62ed5b8b1a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed class AsyncSearchStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequest : PlainRequest +{ + public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.status"; +} + +/// +/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor, AsyncSearchStatusRequestParameters> +{ + internal AsyncSearchStatusRequestDescriptor(Action> configure) => configure.Invoke(this); + + public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal AsyncSearchStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.status"; + + public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor +{ + internal AsyncSearchStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal AsyncSearchStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.status"; + + public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs new file mode 100644 index 00000000000..86d5ee90665 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs @@ -0,0 +1,66 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse +{ + /// + /// Metadata about clusters involved in the cross-cluster search.
Not shown for local-only searches.
+ ///
+ [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + + /// + /// If the async search completed, this field shows the status code of the search.
For example, 200 indicates that the async search was successfully completed.
503 indicates that the async search was completed with an error.
+ ///
+ [JsonInclude, JsonPropertyName("completion_status")] + public int? CompletionStatus { get; init; } + [JsonInclude, JsonPropertyName("completion_time")] + public DateTimeOffset? CompletionTime { get; init; } + [JsonInclude, JsonPropertyName("completion_time_in_millis")] + public long? CompletionTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("expiration_time")] + public DateTimeOffset? ExpirationTime { get; init; } + [JsonInclude, JsonPropertyName("expiration_time_in_millis")] + public long ExpirationTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("is_partial")] + public bool IsPartial { get; init; } + [JsonInclude, JsonPropertyName("is_running")] + public bool IsRunning { get; init; } + + /// + /// Indicates how many shards have run the query so far. + /// + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs new file mode 100644 index 00000000000..2ee9fd642df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed class DeleteAsyncSearchRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequest : PlainRequest +{ + public DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.delete"; +} + +/// +/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequestDescriptor : RequestDescriptor, DeleteAsyncSearchRequestParameters> +{ + internal DeleteAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeleteAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.delete"; + + public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequestDescriptor : RequestDescriptor +{ + internal DeleteAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeleteAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.delete"; + + public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs new file mode 100644 index 00000000000..a56a97deed4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs new file mode 100644 index 00000000000..04e0a14ab3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed class GetAsyncSearchRequestParameters : RequestParameters +{ + /// + /// Specifies how long the async search should be available in the cluster.
When not specified, the `keep_alive` set with the corresponding submit async request will be used.
Otherwise, it is possible to override the value and extend the validity of the request.
When this period expires, the search, if still running, is cancelled.
If the search is completed, its saved results are deleted.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + + /// + /// Specifies to wait for the search to be completed up until the provided timeout.
Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.
By default no timeout is set meaning that the currently available results will be returned without any additional wait.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } +} + +/// +/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequest : PlainRequest +{ + public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.get"; + + /// + /// Specifies how long the async search should be available in the cluster.
When not specified, the `keep_alive` set with the corresponding submit async request will be used.
Otherwise, it is possible to override the value and extend the validity of the request.
When this period expires, the search, if still running, is cancelled.
If the search is completed, its saved results are deleted.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + + /// + /// Specifies to wait for the search to be completed up until the provided timeout.
Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.
By default no timeout is set meaning that the currently available results will be returned without any additional wait.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } +} + +/// +/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequestDescriptor : RequestDescriptor, GetAsyncSearchRequestParameters> +{ + internal GetAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal GetAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.get"; + + public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive); + public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout); + + public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequestDescriptor : RequestDescriptor +{ + internal GetAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal GetAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "async_search.get"; + + public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive); + public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout); + + public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs new file mode 100644 index 00000000000..69f21655b0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("completion_time")] + public DateTimeOffset? CompletionTime { get; init; } + [JsonInclude, JsonPropertyName("completion_time_in_millis")] + public long? CompletionTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("expiration_time")] + public DateTimeOffset? ExpirationTime { get; init; } + [JsonInclude, JsonPropertyName("expiration_time_in_millis")] + public long ExpirationTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("is_partial")] + public bool IsPartial { get; init; } + [JsonInclude, JsonPropertyName("is_running")] + public bool IsRunning { get; init; } + [JsonInclude, JsonPropertyName("response")] + public Elastic.Clients.Elasticsearch.Serverless.AsyncSearch.AsyncSearch Response { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs new file mode 100644 index 00000000000..d5d7c2b123a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs @@ -0,0 +1,3088 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed class SubmitAsyncSearchRequestParameters : RequestParameters +{ + /// + /// Blocks and waits until the search is completed up to a certain timeout.
When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } + + /// + /// If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`. + /// + public bool? KeepOnCompletion { get => Q("keep_on_completion"); set => Q("keep_on_completion", value); } + + /// + /// Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Indicate if an error should be returned if there is a partial search failure or timeout + /// + public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); } + + /// + /// The analyzer to use for the query string + /// + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// Affects how often partial results become available, which happens whenever shard results are reduced.
A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
+ ///
+ public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); } + + /// + /// The default value is the only supported value. + /// + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + /// + public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped. + /// + public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to true + /// + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// A comma-separated list of specific routing values + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Search operation type + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies which field to use for suggestions. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); } + + /// + /// Specify suggest mode + /// + public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); } + + /// + /// How many suggestions to return in response + /// + public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); } + + /// + /// The source text for which the suggestions should be returned. + /// + public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Query in the Lucene query string syntax + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } +} + +internal sealed partial class SubmitAsyncSearchRequestConverter : JsonConverter +{ + public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new SubmitAsyncSearchRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations" || property == "aggs") + { + variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "collapse") + { + variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "explain") + { + variant.Explain = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ext") + { + variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "highlight") + { + variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_total_hits") + { + variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_boost") + { + variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + continue; + } + + if (property == "docvalue_fields") + { + variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "knn") + { + variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "min_score") + { + variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "post_filter") + { + variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "profile") + { + variant.Profile = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rescore") + { + variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "search_after") + { + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "size") + { + variant.Size = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "slice") + { + variant.Slice = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "sort") + { + variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "_source") + { + variant.Source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fields") + { + variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "suggest") + { + variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "terminate_after") + { + variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "timeout") + { + variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_scores") + { + variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "seq_no_primary_term") + { + variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "stored_fields") + { + variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pit") + { + variant.Pit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stats") + { + variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.Collapse is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, value.Collapse, options); + } + + if (value.Explain.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(value.Explain.Value); + } + + if (value.Ext is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, value.Ext, options); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.TrackTotalHits is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, value.TrackTotalHits, options); + } + + if (value.IndicesBoost is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, value.IndicesBoost, options); + } + + if (value.DocvalueFields is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, value.DocvalueFields, options); + } + + if (value.Knn is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, value.Knn, options); + } + + if (value.MinScore.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(value.MinScore.Value); + } + + if (value.PostFilter is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, value.PostFilter, options); + } + + if (value.Profile.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(value.Profile.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.Rescore is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, value.Rescore, options); + } + + if (value.ScriptFields is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, value.ScriptFields, options); + } + + if (value.SearchAfter is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, value.SearchAfter, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Slice is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, value.Slice, options); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + } + + if (value.Source is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, value.Source, options); + } + + if (value.Fields is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, value.Fields, options); + } + + if (value.Suggest is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, value.Suggest, options); + } + + if (value.TerminateAfter.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(value.TerminateAfter.Value); + } + + if (!string.IsNullOrEmpty(value.Timeout)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(value.Timeout); + } + + if (value.TrackScores.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(value.TrackScores.Value); + } + + if (value.Version.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(value.Version.Value); + } + + if (value.SeqNoPrimaryTerm.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value); + } + + if (value.StoredFields is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, value.StoredFields, options); + } + + if (value.Pit is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, value.Pit, options); + } + + if (value.RuntimeMappings is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, value.RuntimeMappings, options); + } + + if (value.Stats is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, value.Stats, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))] +/// +/// Runs a search request asynchronously.
When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
Warning: Async search does not support scroll nor search requests that only include the suggest section.
By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
+///
+public sealed partial class SubmitAsyncSearchRequest : PlainRequest +{ + public SubmitAsyncSearchRequest() + { + } + + public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "async_search.submit"; + + /// + /// Blocks and waits until the search is completed up to a certain timeout.
When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } + + /// + /// If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`. + /// + [JsonIgnore] + public bool? KeepOnCompletion { get => Q("keep_on_completion"); set => Q("keep_on_completion", value); } + + /// + /// Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Indicate if an error should be returned if there is a partial search failure or timeout + /// + [JsonIgnore] + public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); } + + /// + /// The analyzer to use for the query string + /// + [JsonIgnore] + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + [JsonIgnore] + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// Affects how often partial results become available, which happens whenever shard results are reduced.
A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
+ ///
+ [JsonIgnore] + public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); } + + /// + /// The default value is the only supported value. + /// + [JsonIgnore] + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + [JsonIgnore] + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + [JsonIgnore] + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + /// + [JsonIgnore] + public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + [JsonIgnore] + public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped. + /// + [JsonIgnore] + public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to true + /// + [JsonIgnore] + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// A comma-separated list of specific routing values + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Search operation type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies which field to use for suggestions. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); } + + /// + /// Specify suggest mode + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); } + + /// + /// How many suggestions to return in response + /// + [JsonIgnore] + public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); } + + /// + /// The source text for which the suggestions should be returned. + /// + [JsonIgnore] + public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Query in the Lucene query string syntax + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("collapse")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + [JsonInclude, JsonPropertyName("ext")] + public IDictionary? Ext { get; set; } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ [JsonInclude, JsonPropertyName("from")] + public int? From { get; set; } + [JsonInclude, JsonPropertyName("highlight")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ [JsonInclude, JsonPropertyName("track_total_hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; set; } + + /// + /// Boosts the _score of documents from specified indices. + /// + [JsonInclude, JsonPropertyName("indices_boost")] + public ICollection>? IndicesBoost { get; set; } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("docvalue_fields")] + public ICollection? DocvalueFields { get; set; } + + /// + /// Defines the approximate kNN search to run. + /// + [JsonInclude, JsonPropertyName("knn"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnQuery))] + public ICollection? Knn { get; set; } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ [JsonInclude, JsonPropertyName("min_score")] + public double? MinScore { get; set; } + [JsonInclude, JsonPropertyName("post_filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; set; } + [JsonInclude, JsonPropertyName("profile")] + public bool? Profile { get; set; } + + /// + /// Defines the search definition using the Query DSL. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + [JsonInclude, JsonPropertyName("rescore"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore))] + public ICollection? Rescore { get; set; } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + [JsonInclude, JsonPropertyName("search_after")] + public ICollection? SearchAfter { get; set; } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + [JsonInclude, JsonPropertyName("slice")] + public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; } + [JsonInclude, JsonPropertyName("sort"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] + public ICollection? Sort { get; set; } + + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ [JsonInclude, JsonPropertyName("terminate_after")] + public long? TerminateAfter { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("timeout")] + public string? Timeout { get; set; } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + [JsonInclude, JsonPropertyName("track_scores")] + public bool? TrackScores { get; set; } + + /// + /// If true, returns document version as part of a hit. + /// + [JsonInclude, JsonPropertyName("version")] + public bool? Version { get; set; } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ [JsonInclude, JsonPropertyName("seq_no_primary_term")] + public bool? SeqNoPrimaryTerm { get; set; } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ [JsonInclude, JsonPropertyName("stored_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ [JsonInclude, JsonPropertyName("pit")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; set; } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ [JsonInclude, JsonPropertyName("stats")] + public ICollection? Stats { get; set; } +} + +/// +/// Runs a search request asynchronously.
When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
Warning: Async search does not support scroll nor search requests that only include the suggest section.
By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
+///
+public sealed partial class SubmitAsyncSearchRequestDescriptor : RequestDescriptor, SubmitAsyncSearchRequestParameters> +{ + internal SubmitAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SubmitAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "async_search.submit"; + + public SubmitAsyncSearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public SubmitAsyncSearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public SubmitAsyncSearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SubmitAsyncSearchRequestDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) => Qs("allow_partial_search_results", allowPartialSearchResults); + public SubmitAsyncSearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public SubmitAsyncSearchRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public SubmitAsyncSearchRequestDescriptor BatchedReduceSize(long? batchedReduceSize) => Qs("batched_reduce_size", batchedReduceSize); + public SubmitAsyncSearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SubmitAsyncSearchRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public SubmitAsyncSearchRequestDescriptor Df(string? df) => Qs("df", df); + public SubmitAsyncSearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SubmitAsyncSearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SubmitAsyncSearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SubmitAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive); + public SubmitAsyncSearchRequestDescriptor KeepOnCompletion(bool? keepOnCompletion = true) => Qs("keep_on_completion", keepOnCompletion); + public SubmitAsyncSearchRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public SubmitAsyncSearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public SubmitAsyncSearchRequestDescriptor MinCompatibleShardNode(string? minCompatibleShardNode) => Qs("min_compatible_shard_node", minCompatibleShardNode); + public SubmitAsyncSearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public SubmitAsyncSearchRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SubmitAsyncSearchRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public SubmitAsyncSearchRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public SubmitAsyncSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SubmitAsyncSearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SubmitAsyncSearchRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SubmitAsyncSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SubmitAsyncSearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Serverless.Field? suggestField) => Qs("suggest_field", suggestField); + public SubmitAsyncSearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) => Qs("suggest_mode", suggestMode); + public SubmitAsyncSearchRequestDescriptor SuggestSize(long? suggestSize) => Qs("suggest_size", suggestSize); + public SubmitAsyncSearchRequestDescriptor SuggestText(string? suggestText) => Qs("suggest_text", suggestText); + public SubmitAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + public SubmitAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout); + + public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Action> configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public SubmitAsyncSearchRequestDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(Action> configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(params Action>[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(Action> configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(Action> configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(params Action>[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(Action> configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public SubmitAsyncSearchRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public SubmitAsyncSearchRequestDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ public SubmitAsyncSearchRequestDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public SubmitAsyncSearchRequestDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ public SubmitAsyncSearchRequestDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SubmitAsyncSearchRequestDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ public SubmitAsyncSearchRequestDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ public SubmitAsyncSearchRequestDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public SubmitAsyncSearchRequestDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ public SubmitAsyncSearchRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public SubmitAsyncSearchRequestDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Runs a search request asynchronously.
When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
Warning: Async search does not support scroll nor search requests that only include the suggest section.
By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
+///
+public sealed partial class SubmitAsyncSearchRequestDescriptor : RequestDescriptor +{ + internal SubmitAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public SubmitAsyncSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "async_search.submit"; + + public SubmitAsyncSearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public SubmitAsyncSearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public SubmitAsyncSearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SubmitAsyncSearchRequestDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) => Qs("allow_partial_search_results", allowPartialSearchResults); + public SubmitAsyncSearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public SubmitAsyncSearchRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public SubmitAsyncSearchRequestDescriptor BatchedReduceSize(long? batchedReduceSize) => Qs("batched_reduce_size", batchedReduceSize); + public SubmitAsyncSearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SubmitAsyncSearchRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public SubmitAsyncSearchRequestDescriptor Df(string? df) => Qs("df", df); + public SubmitAsyncSearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SubmitAsyncSearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SubmitAsyncSearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SubmitAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive); + public SubmitAsyncSearchRequestDescriptor KeepOnCompletion(bool? keepOnCompletion = true) => Qs("keep_on_completion", keepOnCompletion); + public SubmitAsyncSearchRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public SubmitAsyncSearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public SubmitAsyncSearchRequestDescriptor MinCompatibleShardNode(string? minCompatibleShardNode) => Qs("min_compatible_shard_node", minCompatibleShardNode); + public SubmitAsyncSearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public SubmitAsyncSearchRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SubmitAsyncSearchRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public SubmitAsyncSearchRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public SubmitAsyncSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SubmitAsyncSearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SubmitAsyncSearchRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SubmitAsyncSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SubmitAsyncSearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Serverless.Field? suggestField) => Qs("suggest_field", suggestField); + public SubmitAsyncSearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) => Qs("suggest_mode", suggestMode); + public SubmitAsyncSearchRequestDescriptor SuggestSize(long? suggestSize) => Qs("suggest_size", suggestSize); + public SubmitAsyncSearchRequestDescriptor SuggestText(string? suggestText) => Qs("suggest_text", suggestText); + public SubmitAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + public SubmitAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout); + + public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Collapse(Action configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public SubmitAsyncSearchRequestDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(Action configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Knn(params Action[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor PostFilter(Action configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(Action configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Rescore(params Action[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Slice(Action configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public SubmitAsyncSearchRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public SubmitAsyncSearchRequestDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ public SubmitAsyncSearchRequestDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public SubmitAsyncSearchRequestDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ public SubmitAsyncSearchRequestDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SubmitAsyncSearchRequestDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ public SubmitAsyncSearchRequestDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ public SubmitAsyncSearchRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ public SubmitAsyncSearchRequestDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public SubmitAsyncSearchRequestDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public SubmitAsyncSearchRequestDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ public SubmitAsyncSearchRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public SubmitAsyncSearchRequestDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs new file mode 100644 index 00000000000..b8efdc88cd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed partial class SubmitAsyncSearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("completion_time")] + public DateTimeOffset? CompletionTime { get; init; } + [JsonInclude, JsonPropertyName("completion_time_in_millis")] + public long? CompletionTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("expiration_time")] + public DateTimeOffset? ExpirationTime { get; init; } + [JsonInclude, JsonPropertyName("expiration_time_in_millis")] + public long ExpirationTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("is_partial")] + public bool IsPartial { get; init; } + [JsonInclude, JsonPropertyName("is_running")] + public bool IsRunning { get; init; } + [JsonInclude, JsonPropertyName("response")] + public Elastic.Clients.Elasticsearch.Serverless.AsyncSearch.AsyncSearch Response { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs new file mode 100644 index 00000000000..98072bac216 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class BulkRequestParameters : RequestParameters +{ + /// + /// The pipeline id to preprocess incoming documents with + /// + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// Default list of fields to extract and return from the _source field, can be overridden on each sub-request + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Sets require_alias for all incoming documents. Defaults to unset (false) + /// + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } +} + +/// +/// Allows to perform multiple index/update/delete operations in a single request. +/// +public sealed partial class BulkRequest : PlainRequest +{ + public BulkRequest() + { + } + + public BulkRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceBulk; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "bulk"; + + /// + /// The pipeline id to preprocess incoming documents with + /// + [JsonIgnore] + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// Default list of fields to extract and return from the _source field, can be overridden on each sub-request + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Sets require_alias for all incoming documents. Defaults to unset (false) + /// + [JsonIgnore] + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } +} + +/// +/// Allows to perform multiple index/update/delete operations in a single request. +/// +public sealed partial class BulkRequestDescriptor : RequestDescriptor, BulkRequestParameters> +{ + internal BulkRequestDescriptor(Action> configure) => configure.Invoke(this); + + public BulkRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceBulk; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "bulk"; + + public BulkRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public BulkRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public BulkRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public BulkRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public BulkRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public BulkRequestDescriptor RequireAlias(bool? requireAlias = true) => Qs("require_alias", requireAlias); + public BulkRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public BulkRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public BulkRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Allows to perform multiple index/update/delete operations in a single request. +/// +public sealed partial class BulkRequestDescriptor : RequestDescriptor +{ + internal BulkRequestDescriptor(Action configure) => configure.Invoke(this); + + public BulkRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceBulk; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "bulk"; + + public BulkRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public BulkRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public BulkRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public BulkRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public BulkRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public BulkRequestDescriptor RequireAlias(bool? requireAlias = true) => Qs("require_alias", requireAlias); + public BulkRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public BulkRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public BulkRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs new file mode 100644 index 00000000000..8d8a459a777 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class BulkResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("errors")] + public bool Errors { get; init; } + [JsonInclude, JsonPropertyName("ingest_took")] + public long? IngestTook { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollRequest.g.cs new file mode 100644 index 00000000000..5546255a367 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollRequest.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class ClearScrollRequestParameters : RequestParameters +{ +} + +/// +/// Explicitly clears the search context for a scroll. +/// +public sealed partial class ClearScrollRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceClearScroll; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "clear_scroll"; + + [JsonInclude, JsonPropertyName("scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollIds? ScrollId { get; set; } +} + +/// +/// Explicitly clears the search context for a scroll. +/// +public sealed partial class ClearScrollRequestDescriptor : RequestDescriptor +{ + internal ClearScrollRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearScrollRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceClearScroll; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "clear_scroll"; + + private Elastic.Clients.Elasticsearch.Serverless.ScrollIds? ScrollIdValue { get; set; } + + public ClearScrollRequestDescriptor ScrollId(Elastic.Clients.Elasticsearch.Serverless.ScrollIds? scrollId) + { + ScrollIdValue = scrollId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ScrollIdValue is not null) + { + writer.WritePropertyName("scroll_id"); + JsonSerializer.Serialize(writer, ScrollIdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs new file mode 100644 index 00000000000..dd9c7c49031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ClearScrollResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("num_freed")] + public int NumFreed { get; init; } + [JsonInclude, JsonPropertyName("succeeded")] + public bool Succeeded { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeRequest.g.cs new file mode 100644 index 00000000000..29127cd766f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeRequest.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class ClosePointInTimeRequestParameters : RequestParameters +{ +} + +/// +/// Close a point in time +/// +public sealed partial class ClosePointInTimeRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceClosePointInTime; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "close_point_in_time"; + + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } +} + +/// +/// Close a point in time +/// +public sealed partial class ClosePointInTimeRequestDescriptor : RequestDescriptor +{ + internal ClosePointInTimeRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClosePointInTimeRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceClosePointInTime; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "close_point_in_time"; + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + + public ClosePointInTimeRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs new file mode 100644 index 00000000000..3dadcfa2dbe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ClosePointInTimeResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("num_freed")] + public int NumFreed { get; init; } + [JsonInclude, JsonPropertyName("succeeded")] + public bool Succeeded { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainRequest.g.cs new file mode 100644 index 00000000000..53d80d83970 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainRequest.g.cs @@ -0,0 +1,187 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed class AllocationExplainRequestParameters : RequestParameters +{ + /// + /// If true, returns information about disk usage and shard sizes. + /// + public bool? IncludeDiskInfo { get => Q("include_disk_info"); set => Q("include_disk_info", value); } + + /// + /// If true, returns YES decisions in explanation. + /// + public bool? IncludeYesDecisions { get => Q("include_yes_decisions"); set => Q("include_yes_decisions", value); } +} + +/// +/// Provides explanations for shard allocations in the cluster. +/// +public sealed partial class AllocationExplainRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterAllocationExplain; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.allocation_explain"; + + /// + /// If true, returns information about disk usage and shard sizes. + /// + [JsonIgnore] + public bool? IncludeDiskInfo { get => Q("include_disk_info"); set => Q("include_disk_info", value); } + + /// + /// If true, returns YES decisions in explanation. + /// + [JsonIgnore] + public bool? IncludeYesDecisions { get => Q("include_yes_decisions"); set => Q("include_yes_decisions", value); } + + /// + /// Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. + /// + [JsonInclude, JsonPropertyName("current_node")] + public string? CurrentNode { get; set; } + + /// + /// Specifies the name of the index that you would like an explanation for. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// If true, returns explanation for the primary shard for the given shard ID. + /// + [JsonInclude, JsonPropertyName("primary")] + public bool? Primary { get; set; } + + /// + /// Specifies the ID of the shard that you would like an explanation for. + /// + [JsonInclude, JsonPropertyName("shard")] + public int? Shard { get; set; } +} + +/// +/// Provides explanations for shard allocations in the cluster. +/// +public sealed partial class AllocationExplainRequestDescriptor : RequestDescriptor +{ + internal AllocationExplainRequestDescriptor(Action configure) => configure.Invoke(this); + + public AllocationExplainRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterAllocationExplain; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.allocation_explain"; + + public AllocationExplainRequestDescriptor IncludeDiskInfo(bool? includeDiskInfo = true) => Qs("include_disk_info", includeDiskInfo); + public AllocationExplainRequestDescriptor IncludeYesDecisions(bool? includeYesDecisions = true) => Qs("include_yes_decisions", includeYesDecisions); + + private string? CurrentNodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private bool? PrimaryValue { get; set; } + private int? ShardValue { get; set; } + + /// + /// Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. + /// + public AllocationExplainRequestDescriptor CurrentNode(string? currentNode) + { + CurrentNodeValue = currentNode; + return Self; + } + + /// + /// Specifies the name of the index that you would like an explanation for. + /// + public AllocationExplainRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// If true, returns explanation for the primary shard for the given shard ID. + /// + public AllocationExplainRequestDescriptor Primary(bool? primary = true) + { + PrimaryValue = primary; + return Self; + } + + /// + /// Specifies the ID of the shard that you would like an explanation for. + /// + public AllocationExplainRequestDescriptor Shard(int? shard) + { + ShardValue = shard; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CurrentNodeValue)) + { + writer.WritePropertyName("current_node"); + writer.WriteStringValue(CurrentNodeValue); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (PrimaryValue.HasValue) + { + writer.WritePropertyName("primary"); + writer.WriteBooleanValue(PrimaryValue.Value); + } + + if (ShardValue.HasValue) + { + writer.WritePropertyName("shard"); + writer.WriteNumberValue(ShardValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs new file mode 100644 index 00000000000..7f725186e7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class AllocationExplainResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allocate_explanation")] + public string? AllocateExplanation { get; init; } + [JsonInclude, JsonPropertyName("allocation_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? AllocationDelay { get; init; } + [JsonInclude, JsonPropertyName("allocation_delay_in_millis")] + public long? AllocationDelayInMillis { get; init; } + [JsonInclude, JsonPropertyName("can_allocate")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanAllocate { get; init; } + [JsonInclude, JsonPropertyName("can_move_to_other_node")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanMoveToOtherNode { get; init; } + [JsonInclude, JsonPropertyName("can_rebalance_cluster")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRebalanceCluster { get; init; } + [JsonInclude, JsonPropertyName("can_rebalance_cluster_decisions")] + public IReadOnlyCollection? CanRebalanceClusterDecisions { get; init; } + [JsonInclude, JsonPropertyName("can_rebalance_to_other_node")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRebalanceToOtherNode { get; init; } + [JsonInclude, JsonPropertyName("can_remain_decisions")] + public IReadOnlyCollection? CanRemainDecisions { get; init; } + [JsonInclude, JsonPropertyName("can_remain_on_current_node")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRemainOnCurrentNode { get; init; } + [JsonInclude, JsonPropertyName("cluster_info")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterInfo? ClusterInfo { get; init; } + [JsonInclude, JsonPropertyName("configured_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ConfiguredDelay { get; init; } + [JsonInclude, JsonPropertyName("configured_delay_in_millis")] + public long? ConfiguredDelayInMillis { get; init; } + [JsonInclude, JsonPropertyName("current_node")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.CurrentNode? CurrentNode { get; init; } + [JsonInclude, JsonPropertyName("current_state")] + public string CurrentState { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("move_explanation")] + public string? MoveExplanation { get; init; } + [JsonInclude, JsonPropertyName("node_allocation_decisions")] + public IReadOnlyCollection? NodeAllocationDecisions { get; init; } + [JsonInclude, JsonPropertyName("note")] + public string? Note { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("rebalance_explanation")] + public string? RebalanceExplanation { get; init; } + [JsonInclude, JsonPropertyName("remaining_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? RemainingDelay { get; init; } + [JsonInclude, JsonPropertyName("remaining_delay_in_millis")] + public long? RemainingDelayInMillis { get; init; } + [JsonInclude, JsonPropertyName("shard")] + public int Shard { get; init; } + [JsonInclude, JsonPropertyName("unassigned_info")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.UnassignedInformation? UnassignedInfo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs new file mode 100644 index 00000000000..572d83d3724 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed class ClusterStatsRequestParameters : RequestParameters +{ + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Period to wait for each node to respond.
If a node does not respond before its timeout expires, the response does not include its stats.
However, timed out nodes are included in the response’s `_nodes.failed` property. Defaults to no timeout.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster statistics.
It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).
+///
+public sealed partial class ClusterStatsRequest : PlainRequest +{ + public ClusterStatsRequest() + { + } + + public ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? node_id) : base(r => r.Optional("node_id", node_id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.stats"; + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Period to wait for each node to respond.
If a node does not respond before its timeout expires, the response does not include its stats.
However, timed out nodes are included in the response’s `_nodes.failed` property. Defaults to no timeout.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster statistics.
It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).
+///
+public sealed partial class ClusterStatsRequestDescriptor : RequestDescriptor +{ + internal ClusterStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClusterStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.stats"; + + public ClusterStatsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ClusterStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? node_id) + { + RouteValues.Optional("node_id", node_id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs new file mode 100644 index 00000000000..9dd7e4eef08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterStatsResponse : ElasticsearchResponse +{ + /// + /// Name of the cluster, based on the cluster name setting. + /// + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + + /// + /// Unique identifier for the cluster. + /// + [JsonInclude, JsonPropertyName("cluster_uuid")] + public string ClusterUuid { get; init; } + + /// + /// Contains statistics about indices with shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterIndices Indices { get; init; } + + /// + /// Contains statistics about nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("nodes")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterNodes Nodes { get; init; } + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { get; init; } + + /// + /// Health status of the cluster, based on the state of its primary and replica shards. + /// + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } + + /// + /// Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs new file mode 100644 index 00000000000..b156756b9b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed class GetClusterSettingsRequestParameters : RequestParameters +{ + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns default cluster settings from the local node. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster-wide settings.
By default, it returns only settings that have been explicitly defined.
+///
+public sealed partial class GetClusterSettingsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_settings"; + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns default cluster settings from the local node. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster-wide settings.
By default, it returns only settings that have been explicitly defined.
+///
+public sealed partial class GetClusterSettingsRequestDescriptor : RequestDescriptor +{ + internal GetClusterSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetClusterSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_settings"; + + public GetClusterSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetClusterSettingsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetClusterSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetClusterSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs new file mode 100644 index 00000000000..643c4d2e92c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class GetClusterSettingsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("defaults")] + public IReadOnlyDictionary? Defaults { get; init; } + [JsonInclude, JsonPropertyName("persistent")] + public IReadOnlyDictionary Persistent { get; init; } + [JsonInclude, JsonPropertyName("transient")] + public IReadOnlyDictionary Transient { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs new file mode 100644 index 00000000000..066b713ff5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs @@ -0,0 +1,260 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed class HealthRequestParameters : RequestParameters +{ + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// + public Elastic.Clients.Elasticsearch.Serverless.Level? Level { get => Q("level"); set => Q("level", value); } + + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForEvents? WaitForEvents { get => Q("wait_for_events"); set => Q("wait_for_events", value); } + + /// + /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and + /// + public Union? WaitForNodes { get => Q?>("wait_for_nodes"); set => Q("wait_for_nodes", value); } + + /// + /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. + /// + public bool? WaitForNoInitializingShards { get => Q("wait_for_no_initializing_shards"); set => Q("wait_for_no_initializing_shards", value); } + + /// + /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// + public bool? WaitForNoRelocatingShards { get => Q("wait_for_no_relocating_shards"); set => Q("wait_for_no_relocating_shards", value); } + + /// + /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus? WaitForStatus { get => Q("wait_for_status"); set => Q("wait_for_status", value); } +} + +/// +/// The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices.
The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.
+///
+public sealed partial class HealthRequest : PlainRequest +{ + public HealthRequest() + { + } + + public HealthRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterHealth; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.health"; + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Level? Level { get => Q("level"); set => Q("level", value); } + + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForEvents? WaitForEvents { get => Q("wait_for_events"); set => Q("wait_for_events", value); } + + /// + /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and + /// + [JsonIgnore] + public Union? WaitForNodes { get => Q?>("wait_for_nodes"); set => Q("wait_for_nodes", value); } + + /// + /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. + /// + [JsonIgnore] + public bool? WaitForNoInitializingShards { get => Q("wait_for_no_initializing_shards"); set => Q("wait_for_no_initializing_shards", value); } + + /// + /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// + [JsonIgnore] + public bool? WaitForNoRelocatingShards { get => Q("wait_for_no_relocating_shards"); set => Q("wait_for_no_relocating_shards", value); } + + /// + /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus? WaitForStatus { get => Q("wait_for_status"); set => Q("wait_for_status", value); } +} + +/// +/// The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices.
The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.
+///
+public sealed partial class HealthRequestDescriptor : RequestDescriptor, HealthRequestParameters> +{ + internal HealthRequestDescriptor(Action> configure) => configure.Invoke(this); + + public HealthRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterHealth; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.health"; + + public HealthRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public HealthRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + public HealthRequestDescriptor Local(bool? local = true) => Qs("local", local); + public HealthRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.Serverless.WaitForEvents? waitForEvents) => Qs("wait_for_events", waitForEvents); + public HealthRequestDescriptor WaitForNoInitializingShards(bool? waitForNoInitializingShards = true) => Qs("wait_for_no_initializing_shards", waitForNoInitializingShards); + public HealthRequestDescriptor WaitForNoRelocatingShards(bool? waitForNoRelocatingShards = true) => Qs("wait_for_no_relocating_shards", waitForNoRelocatingShards); + public HealthRequestDescriptor WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForStatus(Elastic.Clients.Elasticsearch.Serverless.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); + + public HealthRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices.
The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.
+///
+public sealed partial class HealthRequestDescriptor : RequestDescriptor +{ + internal HealthRequestDescriptor(Action configure) => configure.Invoke(this); + + public HealthRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterHealth; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.health"; + + public HealthRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public HealthRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + public HealthRequestDescriptor Local(bool? local = true) => Qs("local", local); + public HealthRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.Serverless.WaitForEvents? waitForEvents) => Qs("wait_for_events", waitForEvents); + public HealthRequestDescriptor WaitForNoInitializingShards(bool? waitForNoInitializingShards = true) => Qs("wait_for_no_initializing_shards", waitForNoInitializingShards); + public HealthRequestDescriptor WaitForNoRelocatingShards(bool? waitForNoRelocatingShards = true) => Qs("wait_for_no_relocating_shards", waitForNoRelocatingShards); + public HealthRequestDescriptor WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForStatus(Elastic.Clients.Elasticsearch.Serverless.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); + + public HealthRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs new file mode 100644 index 00000000000..a5c30753ba4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs @@ -0,0 +1,124 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class HealthResponse : ElasticsearchResponse +{ + /// + /// The number of active primary shards. + /// + [JsonInclude, JsonPropertyName("active_primary_shards")] + public int ActivePrimaryShards { get; init; } + + /// + /// The total number of active primary and replica shards. + /// + [JsonInclude, JsonPropertyName("active_shards")] + public int ActiveShards { get; init; } + + /// + /// The ratio of active shards in the cluster expressed as a percentage. + /// + [JsonInclude, JsonPropertyName("active_shards_percent_as_number")] + public double ActiveShardsPercentAsNumber { get; init; } + + /// + /// The name of the cluster. + /// + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + + /// + /// The number of shards whose allocation has been delayed by the timeout settings. + /// + [JsonInclude, JsonPropertyName("delayed_unassigned_shards")] + public int DelayedUnassignedShards { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexHealthStats))] + public IReadOnlyDictionary? Indices { get; init; } + + /// + /// The number of shards that are under initialization. + /// + [JsonInclude, JsonPropertyName("initializing_shards")] + public int InitializingShards { get; init; } + + /// + /// The number of nodes that are dedicated data nodes. + /// + [JsonInclude, JsonPropertyName("number_of_data_nodes")] + public int NumberOfDataNodes { get; init; } + + /// + /// The number of unfinished fetches. + /// + [JsonInclude, JsonPropertyName("number_of_in_flight_fetch")] + public int NumberOfInFlightFetch { get; init; } + + /// + /// The number of nodes within the cluster. + /// + [JsonInclude, JsonPropertyName("number_of_nodes")] + public int NumberOfNodes { get; init; } + + /// + /// The number of cluster-level changes that have not yet been executed. + /// + [JsonInclude, JsonPropertyName("number_of_pending_tasks")] + public int NumberOfPendingTasks { get; init; } + + /// + /// The number of shards that are under relocation. + /// + [JsonInclude, JsonPropertyName("relocating_shards")] + public int RelocatingShards { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } + + /// + /// The time since the earliest initiated task is waiting for being performed. + /// + [JsonInclude, JsonPropertyName("task_max_waiting_in_queue")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TaskMaxWaitingInQueue { get; init; } + + /// + /// The time expressed in milliseconds since the earliest initiated task is waiting for being performed. + /// + [JsonInclude, JsonPropertyName("task_max_waiting_in_queue_millis")] + public long TaskMaxWaitingInQueueMillis { get; init; } + + /// + /// If false the response returned within the period of time that is specified by the timeout parameter (30s by default) + /// + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + + /// + /// The number of shards that are not allocated. + /// + [JsonInclude, JsonPropertyName("unassigned_shards")] + public int UnassignedShards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksRequest.g.cs new file mode 100644 index 00000000000..5e325a5c7a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksRequest.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed class PendingTasksRequestParameters : RequestParameters +{ + /// + /// If `true`, the request retrieves information from the local node only.
If `false`, information is retrieved from the master node.
+ ///
+ public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.
NOTE: This API returns a list of any pending updates to the cluster state.
These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests.
However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
+///
+public sealed partial class PendingTasksRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPendingTasks; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.pending_tasks"; + + /// + /// If `true`, the request retrieves information from the local node only.
If `false`, information is retrieved from the master node.
+ ///
+ [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.
NOTE: This API returns a list of any pending updates to the cluster state.
These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests.
However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
+///
+public sealed partial class PendingTasksRequestDescriptor : RequestDescriptor +{ + internal PendingTasksRequestDescriptor(Action configure) => configure.Invoke(this); + + public PendingTasksRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPendingTasks; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.pending_tasks"; + + public PendingTasksRequestDescriptor Local(bool? local = true) => Qs("local", local); + public PendingTasksRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs new file mode 100644 index 00000000000..dcd578fe077 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class PendingTasksResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("tasks")] + public IReadOnlyCollection Tasks { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs new file mode 100644 index 00000000000..6a07cd81e8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs @@ -0,0 +1,401 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class CountRequestParameters : RequestParameters +{ + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Include only documents with a specific `_score` value in the result + /// + public double? MinScore { get => Q("min_score"); set => Q("min_score", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// A comma-separated list of specific routing values + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// The maximum count for each shard, upon reaching which the query execution will terminate early + /// + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Query in the Lucene query string syntax + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } +} + +/// +/// Returns number of documents matching a query. +/// +public partial class CountRequest : PlainRequest +{ + public CountRequest() + { + } + + public CountRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceCount; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "count"; + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + [JsonIgnore] + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + [JsonIgnore] + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + [JsonIgnore] + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + [JsonIgnore] + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Include only documents with a specific `_score` value in the result + /// + [JsonIgnore] + public double? MinScore { get => Q("min_score"); set => Q("min_score", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// A comma-separated list of specific routing values + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// The maximum count for each shard, upon reaching which the query execution will terminate early + /// + [JsonIgnore] + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Query in the Lucene query string syntax + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } +} + +/// +/// Returns number of documents matching a query. +/// +public sealed partial class CountRequestDescriptor : RequestDescriptor, CountRequestParameters> +{ + internal CountRequestDescriptor(Action> configure) => configure.Invoke(this); + + public CountRequestDescriptor() : this(typeof(TDocument)) + { + } + + public CountRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceCount; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "count"; + + public CountRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public CountRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public CountRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public CountRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public CountRequestDescriptor Df(string? df) => Qs("df", df); + public CountRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public CountRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public CountRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public CountRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public CountRequestDescriptor MinScore(double? minScore) => Qs("min_score", minScore); + public CountRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public CountRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public CountRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public CountRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + + public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public CountRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Returns number of documents matching a query. +/// +public sealed partial class CountRequestDescriptor : RequestDescriptor +{ + internal CountRequestDescriptor(Action configure) => configure.Invoke(this); + + public CountRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public CountRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceCount; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "count"; + + public CountRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public CountRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public CountRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public CountRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public CountRequestDescriptor Df(string? df) => Qs("df", df); + public CountRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public CountRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public CountRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public CountRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public CountRequestDescriptor MinScore(double? minScore) => Qs("min_score", minScore); + public CountRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public CountRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public CountRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public CountRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + + public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public CountRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs new file mode 100644 index 00000000000..a21aac40033 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class CountResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs new file mode 100644 index 00000000000..b17552ddfa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class CreateRequestParameters : RequestParameters +{ + /// + /// The pipeline id to preprocess incoming documents with + /// + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Creates a new document in the index. +/// Returns a 409 response when a document with a same ID already exists in the index. +/// +public sealed partial class CreateRequest : PlainRequest +{ + public CreateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "create"; + + [JsonIgnore] + public TDocument Document { get; set; } + + /// + /// The pipeline id to preprocess incoming documents with + /// + [JsonIgnore] + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Creates a new document in the index. +/// Returns a 409 response when a document with a same ID already exists in the index. +/// +public sealed partial class CreateRequestDescriptor : RequestDescriptor, CreateRequestParameters> +{ + internal CreateRequestDescriptor(Action> configure) => configure.Invoke(this); + + internal CreateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public CreateRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) => DocumentValue = document; + public CreateRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) => DocumentValue = document; + public CreateRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) => DocumentValue = document; + public CreateRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) => DocumentValue = document; + + public CreateRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal CreateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "create"; + + public CreateRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public CreateRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public CreateRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public CreateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CreateRequestDescriptor Version(long? version) => Qs("version", version); + public CreateRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + public CreateRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public CreateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public CreateRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private TDocument DocumentValue { get; set; } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs new file mode 100644 index 00000000000..2d398c5c1be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class CreateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs new file mode 100644 index 00000000000..836b7e08810 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs @@ -0,0 +1,695 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class DeleteByQueryRequestParameters : RequestParameters +{ + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// What to do when the delete by query hits version conflicts? + /// + public Elastic.Clients.Elasticsearch.Serverless.Conflicts? Conflicts { get => Q("conflicts"); set => Q("conflicts", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Starting offset (default: 0) + /// + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Should the affected indexes be refreshed? + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to index level setting + /// + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// The throttle for this request in sub-requests per second. -1 means no throttle. + /// + public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } + + /// + /// A comma-separated list of specific routing values + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Query in the Lucene query string syntax + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// Specify how long a consistent view of the index should be maintained for scrolled search + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Size on the scroll request powering the delete by query + /// + public long? ScrollSize { get => Q("scroll_size"); set => Q("scroll_size", value); } + + /// + /// Explicit timeout for each search request. Defaults to no timeout. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? SearchTimeout { get => Q("search_timeout"); set => Q("search_timeout", value); } + + /// + /// Search operation type + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Slices? Slices { get => Q("slices"); set => Q("slices", value); } + + /// + /// A comma-separated list of : pairs + /// + public ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } + + /// + /// Specific 'tag' of the request for logging and statistical purposes + /// + public ICollection? Stats { get => Q?>("stats"); set => Q("stats", value); } + + /// + /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + /// + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Time each individual bulk request should wait for shards that are unavailable. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specify whether to return document version as part of a hit + /// + public bool? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Should the request should block until the delete by query is complete. + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Deletes documents matching the provided query. +/// +public sealed partial class DeleteByQueryRequest : PlainRequest +{ + public DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "delete_by_query"; + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + [JsonIgnore] + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + [JsonIgnore] + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// What to do when the delete by query hits version conflicts? + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Conflicts? Conflicts { get => Q("conflicts"); set => Q("conflicts", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + [JsonIgnore] + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Starting offset (default: 0) + /// + [JsonIgnore] + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Should the affected indexes be refreshed? + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to index level setting + /// + [JsonIgnore] + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// The throttle for this request in sub-requests per second. -1 means no throttle. + /// + [JsonIgnore] + public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } + + /// + /// A comma-separated list of specific routing values + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Query in the Lucene query string syntax + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// Specify how long a consistent view of the index should be maintained for scrolled search + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Size on the scroll request powering the delete by query + /// + [JsonIgnore] + public long? ScrollSize { get => Q("scroll_size"); set => Q("scroll_size", value); } + + /// + /// Explicit timeout for each search request. Defaults to no timeout. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? SearchTimeout { get => Q("search_timeout"); set => Q("search_timeout", value); } + + /// + /// Search operation type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Slices? Slices { get => Q("slices"); set => Q("slices", value); } + + /// + /// A comma-separated list of : pairs + /// + [JsonIgnore] + public ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } + + /// + /// Specific 'tag' of the request for logging and statistical purposes + /// + [JsonIgnore] + public ICollection? Stats { get => Q?>("stats"); set => Q("stats", value); } + + /// + /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + /// + [JsonIgnore] + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Time each individual bulk request should wait for shards that are unavailable. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specify whether to return document version as part of a hit + /// + [JsonIgnore] + public bool? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Should the request should block until the delete by query is complete. + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + [JsonInclude, JsonPropertyName("max_docs")] + public long? MaxDocs { get; set; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + [JsonInclude, JsonPropertyName("slice")] + public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; } +} + +/// +/// Deletes documents matching the provided query. +/// +public sealed partial class DeleteByQueryRequestDescriptor : RequestDescriptor, DeleteByQueryRequestParameters> +{ + internal DeleteByQueryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal DeleteByQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "delete_by_query"; + + public DeleteByQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DeleteByQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public DeleteByQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public DeleteByQueryRequestDescriptor Conflicts(Elastic.Clients.Elasticsearch.Serverless.Conflicts? conflicts) => Qs("conflicts", conflicts); + public DeleteByQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public DeleteByQueryRequestDescriptor Df(string? df) => Qs("df", df); + public DeleteByQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DeleteByQueryRequestDescriptor From(long? from) => Qs("from", from); + public DeleteByQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DeleteByQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public DeleteByQueryRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public DeleteByQueryRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public DeleteByQueryRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public DeleteByQueryRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public DeleteByQueryRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); + public DeleteByQueryRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public DeleteByQueryRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public DeleteByQueryRequestDescriptor ScrollSize(long? scrollSize) => Qs("scroll_size", scrollSize); + public DeleteByQueryRequestDescriptor SearchTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? searchTimeout) => Qs("search_timeout", searchTimeout); + public DeleteByQueryRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public DeleteByQueryRequestDescriptor Slices(Elastic.Clients.Elasticsearch.Serverless.Slices? slices) => Qs("slices", slices); + public DeleteByQueryRequestDescriptor Sort(ICollection? sort) => Qs("sort", sort); + public DeleteByQueryRequestDescriptor Stats(ICollection? stats) => Qs("stats", stats); + public DeleteByQueryRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + public DeleteByQueryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public DeleteByQueryRequestDescriptor Version(bool? version = true) => Qs("version", version); + public DeleteByQueryRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public DeleteByQueryRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } + private long? MaxDocsValue { get; set; } + + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DeleteByQueryRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(Action> configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public DeleteByQueryRequestDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (MaxDocsValue.HasValue) + { + writer.WritePropertyName("max_docs"); + writer.WriteNumberValue(MaxDocsValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Deletes documents matching the provided query. +/// +public sealed partial class DeleteByQueryRequestDescriptor : RequestDescriptor +{ + internal DeleteByQueryRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal DeleteByQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "delete_by_query"; + + public DeleteByQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DeleteByQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public DeleteByQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public DeleteByQueryRequestDescriptor Conflicts(Elastic.Clients.Elasticsearch.Serverless.Conflicts? conflicts) => Qs("conflicts", conflicts); + public DeleteByQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public DeleteByQueryRequestDescriptor Df(string? df) => Qs("df", df); + public DeleteByQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DeleteByQueryRequestDescriptor From(long? from) => Qs("from", from); + public DeleteByQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DeleteByQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public DeleteByQueryRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public DeleteByQueryRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public DeleteByQueryRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public DeleteByQueryRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public DeleteByQueryRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); + public DeleteByQueryRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public DeleteByQueryRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public DeleteByQueryRequestDescriptor ScrollSize(long? scrollSize) => Qs("scroll_size", scrollSize); + public DeleteByQueryRequestDescriptor SearchTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? searchTimeout) => Qs("search_timeout", searchTimeout); + public DeleteByQueryRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public DeleteByQueryRequestDescriptor Slices(Elastic.Clients.Elasticsearch.Serverless.Slices? slices) => Qs("slices", slices); + public DeleteByQueryRequestDescriptor Sort(ICollection? sort) => Qs("sort", sort); + public DeleteByQueryRequestDescriptor Stats(ICollection? stats) => Qs("stats", stats); + public DeleteByQueryRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + public DeleteByQueryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public DeleteByQueryRequestDescriptor Version(bool? version = true) => Qs("version", version); + public DeleteByQueryRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public DeleteByQueryRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } + private long? MaxDocsValue { get; set; } + + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DeleteByQueryRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public DeleteByQueryRequestDescriptor Slice(Action configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public DeleteByQueryRequestDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (MaxDocsValue.HasValue) + { + writer.WritePropertyName("max_docs"); + writer.WriteNumberValue(MaxDocsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs new file mode 100644 index 00000000000..2d0b7197d7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class DeleteByQueryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("batches")] + public long? Batches { get; init; } + [JsonInclude, JsonPropertyName("deleted")] + public long? Deleted { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("noops")] + public long? Noops { get; init; } + [JsonInclude, JsonPropertyName("requests_per_second")] + public float? RequestsPerSecond { get; init; } + [JsonInclude, JsonPropertyName("retries")] + public Elastic.Clients.Elasticsearch.Serverless.Retries? Retries { get; init; } + [JsonInclude, JsonPropertyName("slice_id")] + public int? SliceId { get; init; } + [JsonInclude, JsonPropertyName("task")] + public Elastic.Clients.Elasticsearch.Serverless.TaskId? Task { get; init; } + [JsonInclude, JsonPropertyName("throttled")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Throttled { get; init; } + [JsonInclude, JsonPropertyName("throttled_millis")] + public long? ThrottledMillis { get; init; } + [JsonInclude, JsonPropertyName("throttled_until")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ThrottledUntil { get; init; } + [JsonInclude, JsonPropertyName("throttled_until_millis")] + public long? ThrottledUntilMillis { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool? TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long? Took { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long? Total { get; init; } + [JsonInclude, JsonPropertyName("version_conflicts")] + public long? VersionConflicts { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs new file mode 100644 index 00000000000..616feba89a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs @@ -0,0 +1,257 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class DeleteRequestParameters : RequestParameters +{ + /// + /// only perform the delete operation if the last operation that has changed the document has the specified primary term + /// + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// only perform the delete operation if the last operation that has changed the document has the specified sequence number + /// + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Removes a document from the index. +/// +public partial class DeleteRequest : PlainRequest +{ + public DeleteRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete"; + + /// + /// only perform the delete operation if the last operation that has changed the document has the specified primary term + /// + [JsonIgnore] + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// only perform the delete operation if the last operation that has changed the document has the specified sequence number + /// + [JsonIgnore] + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Removes a document from the index. +/// +public sealed partial class DeleteRequestDescriptor : RequestDescriptor, DeleteRequestParameters> +{ + internal DeleteRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public DeleteRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public DeleteRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public DeleteRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal DeleteRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete"; + + public DeleteRequestDescriptor IfPrimaryTerm(long? ifPrimaryTerm) => Qs("if_primary_term", ifPrimaryTerm); + public DeleteRequestDescriptor IfSeqNo(long? ifSeqNo) => Qs("if_seq_no", ifSeqNo); + public DeleteRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public DeleteRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public DeleteRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public DeleteRequestDescriptor Version(long? version) => Qs("version", version); + public DeleteRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + public DeleteRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public DeleteRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public DeleteRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Removes a document from the index. +/// +public sealed partial class DeleteRequestDescriptor : RequestDescriptor +{ + internal DeleteRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal DeleteRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete"; + + public DeleteRequestDescriptor IfPrimaryTerm(long? ifPrimaryTerm) => Qs("if_primary_term", ifPrimaryTerm); + public DeleteRequestDescriptor IfSeqNo(long? ifSeqNo) => Qs("if_seq_no", ifSeqNo); + public DeleteRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public DeleteRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public DeleteRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public DeleteRequestDescriptor Version(long? version) => Qs("version", version); + public DeleteRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + public DeleteRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public DeleteRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public DeleteRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs new file mode 100644 index 00000000000..38a35496fe3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class DeleteResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs new file mode 100644 index 00000000000..ad5786488be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs @@ -0,0 +1,147 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class DeleteScriptRequestParameters : RequestParameters +{ + /// + /// Specify timeout for connection to master + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a script. +/// +public sealed partial class DeleteScriptRequest : PlainRequest +{ + public DeleteScriptRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete_script"; + + /// + /// Specify timeout for connection to master + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a script. +/// +public sealed partial class DeleteScriptRequestDescriptor : RequestDescriptor, DeleteScriptRequestParameters> +{ + internal DeleteScriptRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeleteScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete_script"; + + public DeleteScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes a script. +/// +public sealed partial class DeleteScriptRequestDescriptor : RequestDescriptor +{ + internal DeleteScriptRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeleteScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "delete_script"; + + public DeleteScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs new file mode 100644 index 00000000000..2311535b967 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class DeleteScriptResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs new file mode 100644 index 00000000000..db386971d63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed class DeletePolicyRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing enrich policy and its enrich index. +/// +public sealed partial class DeletePolicyRequest : PlainRequest +{ + public DeletePolicyRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichDeletePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.delete_policy"; +} + +/// +/// Deletes an existing enrich policy and its enrich index. +/// +public sealed partial class DeletePolicyRequestDescriptor : RequestDescriptor +{ + internal DeletePolicyRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeletePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal DeletePolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichDeletePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.delete_policy"; + + public DeletePolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs new file mode 100644 index 00000000000..a7809f2351d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class DeletePolicyResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsRequest.g.cs new file mode 100644 index 00000000000..eed07e19463 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed class EnrichStatsRequestParameters : RequestParameters +{ +} + +/// +/// Returns enrich coordinator statistics and information about enrich policies that are currently executing. +/// +public sealed partial class EnrichStatsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.stats"; +} + +/// +/// Returns enrich coordinator statistics and information about enrich policies that are currently executing. +/// +public sealed partial class EnrichStatsRequestDescriptor : RequestDescriptor +{ + internal EnrichStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public EnrichStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.stats"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs new file mode 100644 index 00000000000..8a05c76d9bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class EnrichStatsResponse : ElasticsearchResponse +{ + /// + /// Objects containing information about the enrich cache stats on each ingest node. + /// + [JsonInclude, JsonPropertyName("cache_stats")] + public IReadOnlyCollection? CacheStats { get; init; } + + /// + /// Objects containing information about each coordinating ingest node for configured enrich processors. + /// + [JsonInclude, JsonPropertyName("coordinator_stats")] + public IReadOnlyCollection CoordinatorStats { get; init; } + + /// + /// Objects containing information about each enrich policy that is currently executing. + /// + [JsonInclude, JsonPropertyName("executing_policies")] + public IReadOnlyCollection ExecutingPolicies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs new file mode 100644 index 00000000000..c41617fe603 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed class ExecutePolicyRequestParameters : RequestParameters +{ + /// + /// If `true`, the request blocks other enrich policy execution requests until complete. + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Creates the enrich index for an existing enrich policy. +/// +public sealed partial class ExecutePolicyRequest : PlainRequest +{ + public ExecutePolicyRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichExecutePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.execute_policy"; + + /// + /// If `true`, the request blocks other enrich policy execution requests until complete. + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Creates the enrich index for an existing enrich policy. +/// +public sealed partial class ExecutePolicyRequestDescriptor : RequestDescriptor +{ + internal ExecutePolicyRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExecutePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal ExecutePolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichExecutePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.execute_policy"; + + public ExecutePolicyRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public ExecutePolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs new file mode 100644 index 00000000000..e70a9bd08b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class ExecutePolicyResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Enrich.ExecuteEnrichPolicyStatus Status { get; init; } + [JsonInclude, JsonPropertyName("task_id")] + public Elastic.Clients.Elasticsearch.Serverless.TaskId? TaskId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs new file mode 100644 index 00000000000..aeafb3d8e8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed class GetPolicyRequestParameters : RequestParameters +{ +} + +/// +/// Returns information about an enrich policy. +/// +public sealed partial class GetPolicyRequest : PlainRequest +{ + public GetPolicyRequest() + { + } + + public GetPolicyRequest(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichGetPolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.get_policy"; +} + +/// +/// Returns information about an enrich policy. +/// +public sealed partial class GetPolicyRequestDescriptor : RequestDescriptor +{ + internal GetPolicyRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichGetPolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "enrich.get_policy"; + + public GetPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs new file mode 100644 index 00000000000..2436ef2e5c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class GetPolicyResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("policies")] + public IReadOnlyCollection Policies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs new file mode 100644 index 00000000000..0d53bf8b76f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs @@ -0,0 +1,420 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed class PutPolicyRequestParameters : RequestParameters +{ +} + +/// +/// Creates an enrich policy. +/// +public sealed partial class PutPolicyRequest : PlainRequest +{ + public PutPolicyRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "enrich.put_policy"; + + /// + /// Matches enrich data to incoming documents based on a `geo_shape` query. + /// + [JsonInclude, JsonPropertyName("geo_match")] + public Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? GeoMatch { get; set; } + + /// + /// Matches enrich data to incoming documents based on a `term` query. + /// + [JsonInclude, JsonPropertyName("match")] + public Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? Match { get; set; } + + /// + /// Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query. + /// + [JsonInclude, JsonPropertyName("range")] + public Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? Range { get; set; } +} + +/// +/// Creates an enrich policy. +/// +public sealed partial class PutPolicyRequestDescriptor : RequestDescriptor, PutPolicyRequestParameters> +{ + internal PutPolicyRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal PutPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "enrich.put_policy"; + + public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? GeoMatchValue { get; set; } + private EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } + private Action> GeoMatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? MatchValue { get; set; } + private EnrichPolicyDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? RangeValue { get; set; } + private EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action> RangeDescriptorAction { get; set; } + + /// + /// Matches enrich data to incoming documents based on a `geo_shape` query. + /// + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? geoMatch) + { + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = null; + GeoMatchValue = geoMatch; + return Self; + } + + public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor GeoMatch(Action> configure) + { + GeoMatchValue = null; + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = configure; + return Self; + } + + /// + /// Matches enrich data to incoming documents based on a `term` query. + /// + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor Match(Action> configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + /// + /// Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query. + /// + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? range) + { + RangeDescriptor = null; + RangeDescriptorAction = null; + RangeValue = range; + return Self; + } + + public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + { + RangeValue = null; + RangeDescriptorAction = null; + RangeDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor Range(Action> configure) + { + RangeValue = null; + RangeDescriptor = null; + RangeDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (GeoMatchDescriptor is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchDescriptor, options); + } + else if (GeoMatchDescriptorAction is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + } + else if (GeoMatchValue is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchValue, options); + } + + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + } + else if (MatchValue is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (RangeDescriptor is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, RangeDescriptor, options); + } + else if (RangeDescriptorAction is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + } + else if (RangeValue is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, RangeValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates an enrich policy. +/// +public sealed partial class PutPolicyRequestDescriptor : RequestDescriptor +{ + internal PutPolicyRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal PutPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "enrich.put_policy"; + + public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? GeoMatchValue { get; set; } + private EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } + private Action GeoMatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? MatchValue { get; set; } + private EnrichPolicyDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? RangeValue { get; set; } + private EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action RangeDescriptorAction { get; set; } + + /// + /// Matches enrich data to incoming documents based on a `geo_shape` query. + /// + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? geoMatch) + { + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = null; + GeoMatchValue = geoMatch; + return Self; + } + + public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor GeoMatch(Action configure) + { + GeoMatchValue = null; + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = configure; + return Self; + } + + /// + /// Matches enrich data to incoming documents based on a `term` query. + /// + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor Match(Action configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + /// + /// Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query. + /// + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicy? range) + { + RangeDescriptor = null; + RangeDescriptorAction = null; + RangeValue = range; + return Self; + } + + public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + { + RangeValue = null; + RangeDescriptorAction = null; + RangeDescriptor = descriptor; + return Self; + } + + public PutPolicyRequestDescriptor Range(Action configure) + { + RangeValue = null; + RangeDescriptor = null; + RangeDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (GeoMatchDescriptor is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchDescriptor, options); + } + else if (GeoMatchDescriptorAction is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + } + else if (GeoMatchValue is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchValue, options); + } + + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + } + else if (MatchValue is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (RangeDescriptor is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, RangeDescriptor, options); + } + else if (RangeDescriptorAction is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + } + else if (RangeValue is not null) + { + writer.WritePropertyName("range"); + JsonSerializer.Serialize(writer, RangeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs new file mode 100644 index 00000000000..01ffbd691e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class PutPolicyResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs new file mode 100644 index 00000000000..4e5d1732628 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs @@ -0,0 +1,283 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class ExistsRequestParameters : RequestParameters +{ + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specify whether to perform the operation in realtime or search mode + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Refresh the shard containing the document before performing the operation + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// A comma-separated list of stored fields to return in the response + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns information about whether a document exists in an index. +/// +public sealed partial class ExistsRequest : PlainRequest +{ + public ExistsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists"; + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specify whether to perform the operation in realtime or search mode + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Refresh the shard containing the document before performing the operation + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// A comma-separated list of stored fields to return in the response + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns information about whether a document exists in an index. +/// +public sealed partial class ExistsRequestDescriptor : RequestDescriptor, ExistsRequestParameters> +{ + internal ExistsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public ExistsRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public ExistsRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public ExistsRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal ExistsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists"; + + public ExistsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public ExistsRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public ExistsRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public ExistsRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public ExistsRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public ExistsRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public ExistsRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExistsRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public ExistsRequestDescriptor Version(long? version) => Qs("version", version); + public ExistsRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public ExistsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public ExistsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about whether a document exists in an index. +/// +public sealed partial class ExistsRequestDescriptor : RequestDescriptor +{ + internal ExistsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal ExistsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists"; + + public ExistsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public ExistsRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public ExistsRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public ExistsRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public ExistsRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public ExistsRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public ExistsRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExistsRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public ExistsRequestDescriptor Version(long? version) => Qs("version", version); + public ExistsRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public ExistsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public ExistsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs new file mode 100644 index 00000000000..d9657478130 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ExistsResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs new file mode 100644 index 00000000000..37a304b082c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs @@ -0,0 +1,270 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class ExistsSourceRequestParameters : RequestParameters +{ + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specify whether to perform the operation in realtime or search mode + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Refresh the shard containing the document before performing the operation + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns information about whether a document source exists in an index. +/// +public sealed partial class ExistsSourceRequest : PlainRequest +{ + public ExistsSourceRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists_source"; + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specify whether to perform the operation in realtime or search mode + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Refresh the shard containing the document before performing the operation + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A list of fields to exclude from the returned _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A list of fields to extract and return from the _source field + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns information about whether a document source exists in an index. +/// +public sealed partial class ExistsSourceRequestDescriptor : RequestDescriptor, ExistsSourceRequestParameters> +{ + internal ExistsSourceRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public ExistsSourceRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal ExistsSourceRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists_source"; + + public ExistsSourceRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public ExistsSourceRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public ExistsSourceRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public ExistsSourceRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public ExistsSourceRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public ExistsSourceRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public ExistsSourceRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExistsSourceRequestDescriptor Version(long? version) => Qs("version", version); + public ExistsSourceRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public ExistsSourceRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public ExistsSourceRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about whether a document source exists in an index. +/// +public sealed partial class ExistsSourceRequestDescriptor : RequestDescriptor +{ + internal ExistsSourceRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal ExistsSourceRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "exists_source"; + + public ExistsSourceRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public ExistsSourceRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public ExistsSourceRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public ExistsSourceRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public ExistsSourceRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public ExistsSourceRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public ExistsSourceRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExistsSourceRequestDescriptor Version(long? version) => Qs("version", version); + public ExistsSourceRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public ExistsSourceRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public ExistsSourceRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs new file mode 100644 index 00000000000..d1c31ff4ebe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ExistsSourceResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs new file mode 100644 index 00000000000..60d1c51304d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs @@ -0,0 +1,375 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class FieldCapsRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, missing or closed indices are not included in the response. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, unmapped fields are included in the response. + /// + public bool? IncludeUnmapped { get => Q("include_unmapped"); set => Q("include_unmapped", value); } + + /// + /// An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent + /// + public string? Filters { get => Q("filters"); set => Q("filters", value); } + + /// + /// Only return results for fields that have one of the types in the list + /// + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } +} + +/// +/// The field capabilities API returns the information about the capabilities of fields among multiple indices.
The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
of keyword is returned as any other field that belongs to the `keyword` family.
+///
+public sealed partial class FieldCapsRequest : PlainRequest +{ + public FieldCapsRequest() + { + } + + public FieldCapsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceFieldCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "field_caps"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, missing or closed indices are not included in the response. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, unmapped fields are included in the response. + /// + [JsonIgnore] + public bool? IncludeUnmapped { get => Q("include_unmapped"); set => Q("include_unmapped", value); } + + /// + /// An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent + /// + [JsonIgnore] + public string? Filters { get => Q("filters"); set => Q("filters", value); } + + /// + /// Only return results for fields that have one of the types in the list + /// + [JsonIgnore] + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } + + /// + /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. + /// + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + + /// + /// Allows to filter indices if the provided query rewrites to match_none on every shard. + /// + [JsonInclude, JsonPropertyName("index_filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilter { get; set; } + + /// + /// Defines ad-hoc runtime fields in the request similar to the way it is done in search requests.
These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } +} + +/// +/// The field capabilities API returns the information about the capabilities of fields among multiple indices.
The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
of keyword is returned as any other field that belongs to the `keyword` family.
+///
+public sealed partial class FieldCapsRequestDescriptor : RequestDescriptor, FieldCapsRequestParameters> +{ + internal FieldCapsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public FieldCapsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceFieldCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "field_caps"; + + public FieldCapsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public FieldCapsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public FieldCapsRequestDescriptor Filters(string? filters) => Qs("filters", filters); + public FieldCapsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); + public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } + private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + + /// + /// Allows to filter indices if the provided query rewrites to match_none on every shard. + /// + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? indexFilter) + { + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = null; + IndexFilterValue = indexFilter; + return Self; + } + + public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + { + IndexFilterValue = null; + IndexFilterDescriptorAction = null; + IndexFilterDescriptor = descriptor; + return Self; + } + + public FieldCapsRequestDescriptor IndexFilter(Action> configure) + { + IndexFilterValue = null; + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = configure; + return Self; + } + + /// + /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. + /// + public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Defines ad-hoc runtime fields in the request similar to the way it is done in search requests.
These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
+ ///
+ public FieldCapsRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexFilterDescriptor is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterDescriptor, options); + } + else if (IndexFilterDescriptorAction is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + } + else if (IndexFilterValue is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// The field capabilities API returns the information about the capabilities of fields among multiple indices.
The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
of keyword is returned as any other field that belongs to the `keyword` family.
+///
+public sealed partial class FieldCapsRequestDescriptor : RequestDescriptor +{ + internal FieldCapsRequestDescriptor(Action configure) => configure.Invoke(this); + + public FieldCapsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceFieldCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "field_caps"; + + public FieldCapsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public FieldCapsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public FieldCapsRequestDescriptor Filters(string? filters) => Qs("filters", filters); + public FieldCapsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); + public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } + private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + + /// + /// Allows to filter indices if the provided query rewrites to match_none on every shard. + /// + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? indexFilter) + { + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = null; + IndexFilterValue = indexFilter; + return Self; + } + + public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + { + IndexFilterValue = null; + IndexFilterDescriptorAction = null; + IndexFilterDescriptor = descriptor; + return Self; + } + + public FieldCapsRequestDescriptor IndexFilter(Action configure) + { + IndexFilterValue = null; + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = configure; + return Self; + } + + /// + /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. + /// + public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Defines ad-hoc runtime fields in the request similar to the way it is done in search requests.
These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
+ ///
+ public FieldCapsRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexFilterDescriptor is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterDescriptor, options); + } + else if (IndexFilterDescriptorAction is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + } + else if (IndexFilterValue is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs new file mode 100644 index 00000000000..0976c04926f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FieldCapsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyDictionary))] + public IReadOnlyDictionary> Fields { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs new file mode 100644 index 00000000000..9915e2dcb99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs @@ -0,0 +1,283 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class GetRequestParameters : RequestParameters +{ + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Boolean) If true, the request is real-time as opposed to near-real-time. + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Target the specified primary shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return. + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude in the response. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// A comma-separated list of stored fields to return in the response + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type: internal, external, external_gte. + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns a document. +/// +public sealed partial class GetRequest : PlainRequest +{ + public GetRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get"; + + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Boolean) If true, the request is real-time as opposed to near-real-time. + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Target the specified primary shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude in the response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// A comma-separated list of stored fields to return in the response + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type: internal, external, external_gte. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns a document. +/// +public sealed partial class GetRequestDescriptor : RequestDescriptor, GetRequestParameters> +{ + internal GetRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public GetRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public GetRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public GetRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal GetRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get"; + + public GetRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public GetRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public GetRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public GetRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public GetRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public GetRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public GetRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public GetRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public GetRequestDescriptor Version(long? version) => Qs("version", version); + public GetRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public GetRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public GetRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns a document. +/// +public sealed partial class GetRequestDescriptor : RequestDescriptor +{ + internal GetRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal GetRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get"; + + public GetRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public GetRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public GetRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public GetRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public GetRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public GetRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public GetRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public GetRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public GetRequestDescriptor Version(long? version) => Qs("version", version); + public GetRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public GetRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public GetRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs new file mode 100644 index 00000000000..0545bae4445 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GetResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValues? Fields { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long? PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_source")] + [SourceConverter] + public TDocument? Source { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs new file mode 100644 index 00000000000..b58efb8ad6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class GetScriptRequestParameters : RequestParameters +{ + /// + /// Specify timeout for connection to master + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns a script. +/// +public sealed partial class GetScriptRequest : PlainRequest +{ + public GetScriptRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_script"; + + /// + /// Specify timeout for connection to master + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns a script. +/// +public sealed partial class GetScriptRequestDescriptor : RequestDescriptor, GetScriptRequestParameters> +{ + internal GetScriptRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal GetScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_script"; + + public GetScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns a script. +/// +public sealed partial class GetScriptRequestDescriptor : RequestDescriptor +{ + internal GetScriptRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal GetScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_script"; + + public GetScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs new file mode 100644 index 00000000000..a6a3b25283c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GetScriptResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.StoredScript? Script { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs new file mode 100644 index 00000000000..bdcba06231e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs @@ -0,0 +1,275 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class GetSourceRequestParameters : RequestParameters +{ + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Boolean) If true, the request is real-time as opposed to near-real-time. + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Target the specified primary shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return. + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude in the response. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type: internal, external, external_gte. + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns the source of a document. +/// +public sealed partial class GetSourceRequest : PlainRequest +{ + public GetSourceRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_source"; + + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Boolean) If true, the request is real-time as opposed to near-real-time. + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Target the specified primary shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the _source field or not, or a list of fields to return. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude in the response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type: internal, external, external_gte. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns the source of a document. +/// +public sealed partial class GetSourceRequestDescriptor : RequestDescriptor, GetSourceRequestParameters> +{ + internal GetSourceRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public GetSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public GetSourceRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public GetSourceRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal GetSourceRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_source"; + + public GetSourceRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public GetSourceRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public GetSourceRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public GetSourceRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public GetSourceRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public GetSourceRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public GetSourceRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public GetSourceRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public GetSourceRequestDescriptor Version(long? version) => Qs("version", version); + public GetSourceRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public GetSourceRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public GetSourceRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns the source of a document. +/// +public sealed partial class GetSourceRequestDescriptor : RequestDescriptor +{ + internal GetSourceRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal GetSourceRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "get_source"; + + public GetSourceRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public GetSourceRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public GetSourceRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public GetSourceRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public GetSourceRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public GetSourceRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public GetSourceRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public GetSourceRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + public GetSourceRequestDescriptor Version(long? version) => Qs("version", version); + public GetSourceRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public GetSourceRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public GetSourceRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs new file mode 100644 index 00000000000..0c1b9284087 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs @@ -0,0 +1,30 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GetSourceResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs new file mode 100644 index 00000000000..21dbb057bf5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs @@ -0,0 +1,601 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed class ExploreRequestParameters : RequestParameters +{ + /// + /// Custom value used to route operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. +/// +public sealed partial class ExploreRequest : PlainRequest +{ + public ExploreRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "graph.explore"; + + /// + /// Custom value used to route operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specifies or more fields from which you want to extract terms that are associated with the specified vertices. + /// + [JsonInclude, JsonPropertyName("connections")] + public Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? Connections { get; set; } + + /// + /// Direct the Graph API how to build the graph. + /// + [JsonInclude, JsonPropertyName("controls")] + public Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControls? Controls { get; set; } + + /// + /// A seed query that identifies the documents of interest. Can be any valid Elasticsearch query. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// Specifies one or more fields that contain the terms you want to include in the graph as vertices. + /// + [JsonInclude, JsonPropertyName("vertices")] + public ICollection? Vertices { get; set; } +} + +/// +/// Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. +/// +public sealed partial class ExploreRequestDescriptor : RequestDescriptor, ExploreRequestParameters> +{ + internal ExploreRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExploreRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "graph.explore"; + + public ExploreRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExploreRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? ConnectionsValue { get; set; } + private HopDescriptor ConnectionsDescriptor { get; set; } + private Action> ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControls? ControlsValue { get; set; } + private ExploreControlsDescriptor ControlsDescriptor { get; set; } + private Action> ControlsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private ICollection? VerticesValue { get; set; } + private VertexDefinitionDescriptor VerticesDescriptor { get; set; } + private Action> VerticesDescriptorAction { get; set; } + private Action>[] VerticesDescriptorActions { get; set; } + + /// + /// Specifies or more fields from which you want to extract terms that are associated with the specified vertices. + /// + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Connections(Action> configure) + { + ConnectionsValue = null; + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + /// + /// Direct the Graph API how to build the graph. + /// + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControls? controls) + { + ControlsDescriptor = null; + ControlsDescriptorAction = null; + ControlsValue = controls; + return Self; + } + + public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Controls(Action> configure) + { + ControlsValue = null; + ControlsDescriptor = null; + ControlsDescriptorAction = configure; + return Self; + } + + /// + /// A seed query that identifies the documents of interest. Can be any valid Elasticsearch query. + /// + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Specifies one or more fields that contain the terms you want to include in the graph as vertices. + /// + public ExploreRequestDescriptor Vertices(ICollection? vertices) + { + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesValue = vertices; + return Self; + } + + public ExploreRequestDescriptor Vertices(VertexDefinitionDescriptor descriptor) + { + VerticesValue = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Vertices(Action> configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorActions = null; + VerticesDescriptorAction = configure; + return Self; + } + + public ExploreRequestDescriptor Vertices(params Action>[] configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (ControlsDescriptor is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsDescriptor, options); + } + else if (ControlsDescriptorAction is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + } + else if (ControlsValue is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesDescriptor is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, VerticesDescriptor, options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorAction is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorActions is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + foreach (var action in VerticesDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (VerticesValue is not null) + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. +/// +public sealed partial class ExploreRequestDescriptor : RequestDescriptor +{ + internal ExploreRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExploreRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "graph.explore"; + + public ExploreRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public ExploreRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? ConnectionsValue { get; set; } + private HopDescriptor ConnectionsDescriptor { get; set; } + private Action ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControls? ControlsValue { get; set; } + private ExploreControlsDescriptor ControlsDescriptor { get; set; } + private Action ControlsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private ICollection? VerticesValue { get; set; } + private VertexDefinitionDescriptor VerticesDescriptor { get; set; } + private Action VerticesDescriptorAction { get; set; } + private Action[] VerticesDescriptorActions { get; set; } + + /// + /// Specifies or more fields from which you want to extract terms that are associated with the specified vertices. + /// + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Connections(Action configure) + { + ConnectionsValue = null; + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + /// + /// Direct the Graph API how to build the graph. + /// + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControls? controls) + { + ControlsDescriptor = null; + ControlsDescriptorAction = null; + ControlsValue = controls; + return Self; + } + + public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Controls(Action configure) + { + ControlsValue = null; + ControlsDescriptor = null; + ControlsDescriptorAction = configure; + return Self; + } + + /// + /// A seed query that identifies the documents of interest. Can be any valid Elasticsearch query. + /// + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Specifies one or more fields that contain the terms you want to include in the graph as vertices. + /// + public ExploreRequestDescriptor Vertices(ICollection? vertices) + { + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesValue = vertices; + return Self; + } + + public ExploreRequestDescriptor Vertices(VertexDefinitionDescriptor descriptor) + { + VerticesValue = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesDescriptor = descriptor; + return Self; + } + + public ExploreRequestDescriptor Vertices(Action configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorActions = null; + VerticesDescriptorAction = configure; + return Self; + } + + public ExploreRequestDescriptor Vertices(params Action[] configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (ControlsDescriptor is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsDescriptor, options); + } + else if (ControlsDescriptorAction is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + } + else if (ControlsValue is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesDescriptor is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, VerticesDescriptor, options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorAction is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorActions is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + foreach (var action in VerticesDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (VerticesValue is not null) + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs new file mode 100644 index 00000000000..4acdf2edfac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class ExploreResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("connections")] + public IReadOnlyCollection Connections { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection Failures { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } + [JsonInclude, JsonPropertyName("vertices")] + public IReadOnlyCollection Vertices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs new file mode 100644 index 00000000000..c1c710440e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class CloseIndexRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Closes an index. +/// +public sealed partial class CloseIndexRequest : PlainRequest +{ + public CloseIndexRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.close"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Closes an index. +/// +public sealed partial class CloseIndexRequestDescriptor : RequestDescriptor, CloseIndexRequestParameters> +{ + internal CloseIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal CloseIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.close"; + + public CloseIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public CloseIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public CloseIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public CloseIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CloseIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CloseIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public CloseIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Closes an index. +/// +public sealed partial class CloseIndexRequestDescriptor : RequestDescriptor +{ + internal CloseIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal CloseIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.close"; + + public CloseIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public CloseIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public CloseIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public CloseIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CloseIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CloseIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public CloseIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs new file mode 100644 index 00000000000..2ffd3c8b57b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CloseIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CloseIndexResult))] + public IReadOnlyDictionary Indices { get; init; } + [JsonInclude, JsonPropertyName("shards_acknowledged")] + public bool ShardsAcknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs new file mode 100644 index 00000000000..87f95df881b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class CreateDataStreamRequestParameters : RequestParameters +{ +} + +/// +/// Creates a data stream.
You must have a matching index template with data stream enabled.
+///
+public sealed partial class CreateDataStreamRequest : PlainRequest +{ + public CreateDataStreamRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreateDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.create_data_stream"; +} + +/// +/// Creates a data stream.
You must have a matching index template with data stream enabled.
+///
+public sealed partial class CreateDataStreamRequestDescriptor : RequestDescriptor +{ + internal CreateDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public CreateDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name) : base(r => r.Required("name", name)) + { + } + + internal CreateDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreateDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.create_data_stream"; + + public CreateDataStreamRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs new file mode 100644 index 00000000000..cd979e08988 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CreateDataStreamResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs new file mode 100644 index 00000000000..0058a7ef0e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -0,0 +1,404 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class CreateIndexRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Creates a new index. +/// +public sealed partial class CreateIndexRequest : PlainRequest +{ + public CreateIndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.create"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Aliases for the index. + /// + [JsonInclude, JsonPropertyName("aliases")] + public IDictionary? Aliases { get; set; } + + /// + /// Mapping for fields in the index. If specified, this mapping can include:
- Field names
- Field data types
- Mapping parameters
+ ///
+ [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } + + /// + /// Configuration options for the index. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } +} + +/// +/// Creates a new index. +/// +public sealed partial class CreateIndexRequestDescriptor : RequestDescriptor, CreateIndexRequestParameters> +{ + internal CreateIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + public CreateIndexRequestDescriptor(TDocument document) : this(typeof(TDocument)) + { + } + + internal CreateIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.create"; + + public CreateIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CreateIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + + /// + /// Mapping for fields in the index. If specified, this mapping can include:
- Field names
- Field data types
- Mapping parameters
+ ///
+ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public CreateIndexRequestDescriptor Mappings(Action> configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public CreateIndexRequestDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// Aliases for the index. + /// + public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates a new index. +/// +public sealed partial class CreateIndexRequestDescriptor : RequestDescriptor +{ + internal CreateIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal CreateIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.create"; + + public CreateIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CreateIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + + /// + /// Mapping for fields in the index. If specified, this mapping can include:
- Field names
- Field data types
- Mapping parameters
+ ///
+ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public CreateIndexRequestDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public CreateIndexRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// Aliases for the index. + /// + public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs new file mode 100644 index 00000000000..9f6bccef6ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CreateIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("shards_acknowledged")] + public bool ShardsAcknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs new file mode 100644 index 00000000000..9939d6e82c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs @@ -0,0 +1,159 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteAliasRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Removes a data stream or index from an alias. +/// +public sealed partial class DeleteAliasRequest : PlainRequest +{ + public DeleteAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_alias"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Removes a data stream or index from an alias. +/// +public sealed partial class DeleteAliasRequestDescriptor : RequestDescriptor, DeleteAliasRequestParameters> +{ + internal DeleteAliasRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal DeleteAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_alias"; + + public DeleteAliasRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteAliasRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public DeleteAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Removes a data stream or index from an alias. +/// +public sealed partial class DeleteAliasRequestDescriptor : RequestDescriptor +{ + internal DeleteAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal DeleteAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_alias"; + + public DeleteAliasRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteAliasRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public DeleteAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs new file mode 100644 index 00000000000..cdb137df079 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DeleteAliasResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs new file mode 100644 index 00000000000..bb1c5f25d97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs @@ -0,0 +1,124 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteDataLifecycleRequestParameters : RequestParameters +{ + /// + /// Whether wildcard expressions should get expanded to open or closed indices (default: open) + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Specify timeout for connection to master + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit timestamp for the document + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Removes the data lifecycle from a data stream rendering it not managed by DLM +/// +public sealed partial class DeleteDataLifecycleRequest : PlainRequest +{ + public DeleteDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_data_lifecycle"; + + /// + /// Whether wildcard expressions should get expanded to open or closed indices (default: open) + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Specify timeout for connection to master + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit timestamp for the document + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Removes the data lifecycle from a data stream rendering it not managed by DLM +/// +public sealed partial class DeleteDataLifecycleRequestDescriptor : RequestDescriptor +{ + internal DeleteDataLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal DeleteDataLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_data_lifecycle"; + + public DeleteDataLifecycleRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DeleteDataLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteDataLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteDataLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs new file mode 100644 index 00000000000..6cb3ef23d85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// +public sealed partial class DeleteDataLifecycleResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs new file mode 100644 index 00000000000..7def3a951d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteDataStreamRequestParameters : RequestParameters +{ + /// + /// Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } +} + +/// +/// Deletes one or more data streams and their backing indices. +/// +public sealed partial class DeleteDataStreamRequest : PlainRequest +{ + public DeleteDataStreamRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_data_stream"; + + /// + /// Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } +} + +/// +/// Deletes one or more data streams and their backing indices. +/// +public sealed partial class DeleteDataStreamRequestDescriptor : RequestDescriptor +{ + internal DeleteDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal DeleteDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_data_stream"; + + public DeleteDataStreamRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + + public DeleteDataStreamRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs new file mode 100644 index 00000000000..8345a39148f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DeleteDataStreamResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs new file mode 100644 index 00000000000..250342eb614 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteIndexRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes one or more indices. +/// +public sealed partial class DeleteIndexRequest : PlainRequest +{ + public DeleteIndexRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes one or more indices. +/// +public sealed partial class DeleteIndexRequestDescriptor : RequestDescriptor, DeleteIndexRequestParameters> +{ + internal DeleteIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal DeleteIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete"; + + public DeleteIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DeleteIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DeleteIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DeleteIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes one or more indices. +/// +public sealed partial class DeleteIndexRequestDescriptor : RequestDescriptor +{ + internal DeleteIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal DeleteIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete"; + + public DeleteIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DeleteIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DeleteIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DeleteIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs new file mode 100644 index 00000000000..b7f9ebc6e4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DeleteIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs new file mode 100644 index 00000000000..6e3a3ac721e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteIndexTemplateRequestParameters : RequestParameters +{ + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// The provided 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.
+///
+public sealed partial class DeleteIndexTemplateRequest : PlainRequest +{ + public DeleteIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_index_template"; + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// The provided 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.
+///
+public sealed partial class DeleteIndexTemplateRequestDescriptor : RequestDescriptor +{ + internal DeleteIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal DeleteIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_index_template"; + + public DeleteIndexTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteIndexTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs new file mode 100644 index 00000000000..63dd3c9ac8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DeleteIndexTemplateResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs new file mode 100644 index 00000000000..ac13b6c7e71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class DeleteTemplateRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a legacy index template. +/// +public sealed partial class DeleteTemplateRequest : PlainRequest +{ + public DeleteTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_template"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a legacy index template. +/// +public sealed partial class DeleteTemplateRequestDescriptor : RequestDescriptor +{ + internal DeleteTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal DeleteTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.delete_template"; + + public DeleteTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs new file mode 100644 index 00000000000..019344012a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DeleteTemplateResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs new file mode 100644 index 00000000000..9f79a0a1caa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs @@ -0,0 +1,197 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class ExistsAliasRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Checks if an alias exists. +/// +public sealed partial class ExistsAliasRequest : PlainRequest +{ + public ExistsAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + public ExistsAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Optional("index", indices).Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_alias"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Checks if an alias exists. +/// +public sealed partial class ExistsAliasRequestDescriptor : RequestDescriptor, ExistsAliasRequestParameters> +{ + internal ExistsAliasRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Optional("index", indices).Required("name", name)) + { + } + + internal ExistsAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_alias"; + + public ExistsAliasRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ExistsAliasRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ExistsAliasRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ExistsAliasRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Checks if an alias exists. +/// +public sealed partial class ExistsAliasRequestDescriptor : RequestDescriptor +{ + internal ExistsAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Optional("index", indices).Required("name", name)) + { + } + + internal ExistsAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_alias"; + + public ExistsAliasRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ExistsAliasRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ExistsAliasRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ExistsAliasRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs new file mode 100644 index 00000000000..32a923dd00f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ExistsAliasResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs new file mode 100644 index 00000000000..082e9b54bf4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class ExistsIndexTemplateRequestParameters : RequestParameters +{ + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular index template exists. +/// +public sealed partial class ExistsIndexTemplateRequest : PlainRequest +{ + public ExistsIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_index_template"; + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular index template exists. +/// +public sealed partial class ExistsIndexTemplateRequestDescriptor : RequestDescriptor +{ + internal ExistsIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal ExistsIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_index_template"; + + public ExistsIndexTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExistsIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs new file mode 100644 index 00000000000..aad1ea6bc45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ExistsIndexTemplateResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs new file mode 100644 index 00000000000..2fb62490f30 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class ExistsRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, return all default settings in the response. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Checks if a data stream, index, or alias exists. +/// +public sealed partial class ExistsRequest : PlainRequest +{ + public ExistsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, return all default settings in the response. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Checks if a data stream, index, or alias exists. +/// +public sealed partial class ExistsRequestDescriptor : RequestDescriptor, ExistsRequestParameters> +{ + internal ExistsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExistsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists"; + + public ExistsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ExistsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ExistsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ExistsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ExistsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public ExistsRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public ExistsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Checks if a data stream, index, or alias exists. +/// +public sealed partial class ExistsRequestDescriptor : RequestDescriptor +{ + internal ExistsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExistsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists"; + + public ExistsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ExistsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ExistsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ExistsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ExistsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public ExistsRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public ExistsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs new file mode 100644 index 00000000000..94cc7dc0887 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ExistsResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs new file mode 100644 index 00000000000..68971a28f39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class ExistsTemplateRequestParameters : RequestParameters +{ + /// + /// Return settings in flat format (default: false) + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return local information, do not retrieve the state from master node (default: false) + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular index template exists. +/// +public sealed partial class ExistsTemplateRequest : PlainRequest +{ + public ExistsTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_template"; + + /// + /// Return settings in flat format (default: false) + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return local information, do not retrieve the state from master node (default: false) + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular index template exists. +/// +public sealed partial class ExistsTemplateRequestDescriptor : RequestDescriptor +{ + internal ExistsTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal ExistsTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.exists_template"; + + public ExistsTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ExistsTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public ExistsTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExistsTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs new file mode 100644 index 00000000000..28e28fc9a3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ExistsTemplateResponse : ElasticsearchResponse +{ + public bool Exists => ApiCallDetails is + { + HasSuccessfulStatusCode: true, HttpStatusCode: 200 + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs new file mode 100644 index 00000000000..1eaf1c14e11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs @@ -0,0 +1,150 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class ExplainDataLifecycleRequestParameters : RequestParameters +{ + /// + /// indicates if the API should return the default values the system uses for the index's lifecycle + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// Specify timeout for connection to master + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. +/// +public sealed partial class ExplainDataLifecycleRequest : PlainRequest +{ + public ExplainDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.explain_data_lifecycle"; + + /// + /// indicates if the API should return the default values the system uses for the index's lifecycle + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// Specify timeout for connection to master + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. +/// +public sealed partial class ExplainDataLifecycleRequestDescriptor : RequestDescriptor, ExplainDataLifecycleRequestParameters> +{ + internal ExplainDataLifecycleRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExplainDataLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.explain_data_lifecycle"; + + public ExplainDataLifecycleRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public ExplainDataLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExplainDataLifecycleRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. +/// +public sealed partial class ExplainDataLifecycleRequestDescriptor : RequestDescriptor +{ + internal ExplainDataLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal ExplainDataLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.explain_data_lifecycle"; + + public ExplainDataLifecycleRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public ExplainDataLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExplainDataLifecycleRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs new file mode 100644 index 00000000000..23245c157ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// +public sealed partial class ExplainDataLifecycleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("indices")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycleExplain))] + public IReadOnlyDictionary Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs new file mode 100644 index 00000000000..25d28576a09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs @@ -0,0 +1,205 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetAliasRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Retrieves information for one or more aliases. +/// +public sealed partial class GetAliasRequest : PlainRequest +{ + public GetAliasRequest() + { + } + + public GetAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("name", name)) + { + } + + public GetAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_alias"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// Retrieves information for one or more aliases. +/// +public sealed partial class GetAliasRequestDescriptor : RequestDescriptor, GetAliasRequestParameters> +{ + internal GetAliasRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetAliasRequestDescriptor() + { + } + + public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_alias"; + + public GetAliasRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetAliasRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetAliasRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetAliasRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves information for one or more aliases. +/// +public sealed partial class GetAliasRequestDescriptor : RequestDescriptor +{ + internal GetAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetAliasRequestDescriptor() + { + } + + public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_alias"; + + public GetAliasRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetAliasRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetAliasRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetAliasRequestDescriptor Local(bool? local = true) => Qs("local", local); + + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasResponse.g.cs new file mode 100644 index 00000000000..8a3bdeb2e55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetAliasResponse : DictionaryResponse +{ + public GetAliasResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetAliasResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs new file mode 100644 index 00000000000..3bb4329cf71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs @@ -0,0 +1,112 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetDataLifecycleRequestParameters : RequestParameters +{ + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, return all default settings in the response. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Retrieves the data lifecycle configuration of one or more data streams. +/// +public sealed partial class GetDataLifecycleRequest : PlainRequest +{ + public GetDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_data_lifecycle"; + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, return all default settings in the response. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Retrieves the data lifecycle configuration of one or more data streams. +/// +public sealed partial class GetDataLifecycleRequestDescriptor : RequestDescriptor +{ + internal GetDataLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal GetDataLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_data_lifecycle"; + + public GetDataLifecycleRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetDataLifecycleRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + + public GetDataLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs new file mode 100644 index 00000000000..deb6f5f3747 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// +public sealed partial class GetDataLifecycleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs new file mode 100644 index 00000000000..ba6c4f80728 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetDataStreamRequestParameters : RequestParameters +{ + /// + /// Type of data stream that wildcard patterns can match.
Supports comma-separated values, such as `open,hidden`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Retrieves information about one or more data streams. +/// +public sealed partial class GetDataStreamRequest : PlainRequest +{ + public GetDataStreamRequest() + { + } + + public GetDataStreamRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_data_stream"; + + /// + /// Type of data stream that wildcard patterns can match.
Supports comma-separated values, such as `open,hidden`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Retrieves information about one or more data streams. +/// +public sealed partial class GetDataStreamRequestDescriptor : RequestDescriptor +{ + internal GetDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_data_stream"; + + public GetDataStreamRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetDataStreamRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + + public GetDataStreamRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs new file mode 100644 index 00000000000..79d069d0209 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetDataStreamResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs new file mode 100644 index 00000000000..726d5536089 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetIndexRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If false, requests that target a missing index return an error. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, return all default settings in the response. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Return only information on specified index features + /// + public ICollection? Features { get => Q?>("features"); set => Q("features", value); } +} + +/// +/// Returns information about one or more indices. For data streams, the API returns information about the
stream’s backing indices.
+///
+public sealed partial class GetIndexRequest : PlainRequest +{ + public GetIndexRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If false, requests that target a missing index return an error. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, return all default settings in the response. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Return only information on specified index features + /// + [JsonIgnore] + public ICollection? Features { get => Q?>("features"); set => Q("features", value); } +} + +/// +/// Returns information about one or more indices. For data streams, the API returns information about the
stream’s backing indices.
+///
+public sealed partial class GetIndexRequestDescriptor : RequestDescriptor, GetIndexRequestParameters> +{ + internal GetIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal GetIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get"; + + public GetIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndexRequestDescriptor Features(ICollection? features) => Qs("features", features); + public GetIndexRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndexRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndexRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about one or more indices. For data streams, the API returns information about the
stream’s backing indices.
+///
+public sealed partial class GetIndexRequestDescriptor : RequestDescriptor +{ + internal GetIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal GetIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get"; + + public GetIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndexRequestDescriptor Features(ICollection? features) => Qs("features", features); + public GetIndexRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndexRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndexRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexResponse.g.cs new file mode 100644 index 00000000000..b5a079fd310 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetIndexResponse : DictionaryResponse +{ + public GetIndexResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetIndexResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs new file mode 100644 index 00000000000..9756109d109 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetIndexTemplateRequestParameters : RequestParameters +{ + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// If true, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Returns information about one or more index templates. +/// +public sealed partial class GetIndexTemplateRequest : PlainRequest +{ + public GetIndexTemplateRequest() + { + } + + public GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_index_template"; + + /// + /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// If true, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Returns information about one or more index templates. +/// +public sealed partial class GetIndexTemplateRequestDescriptor : RequestDescriptor +{ + internal GetIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_index_template"; + + public GetIndexTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndexTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndexTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndexTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs new file mode 100644 index 00000000000..3f51762fad0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetIndexTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("index_templates")] + public IReadOnlyCollection IndexTemplates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs new file mode 100644 index 00000000000..e502d41a343 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs @@ -0,0 +1,182 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetMappingRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves mapping definitions for one or more indices.
For data streams, the API retrieves mappings for the stream’s backing indices.
+///
+public sealed partial class GetMappingRequest : PlainRequest +{ + public GetMappingRequest() + { + } + + public GetMappingRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_mapping"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves mapping definitions for one or more indices.
For data streams, the API retrieves mappings for the stream’s backing indices.
+///
+public sealed partial class GetMappingRequestDescriptor : RequestDescriptor, GetMappingRequestParameters> +{ + internal GetMappingRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetMappingRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_mapping"; + + public GetMappingRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetMappingRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetMappingRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetMappingRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetMappingRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves mapping definitions for one or more indices.
For data streams, the API retrieves mappings for the stream’s backing indices.
+///
+public sealed partial class GetMappingRequestDescriptor : RequestDescriptor +{ + internal GetMappingRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetMappingRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_mapping"; + + public GetMappingRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetMappingRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetMappingRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetMappingRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetMappingRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingResponse.g.cs new file mode 100644 index 00000000000..c809d68c529 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetMappingResponse : DictionaryResponse +{ + public GetMappingResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetMappingResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs new file mode 100644 index 00000000000..a6f2b3f2e34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class GetTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves information about one or more index templates. +/// +public sealed partial class GetTemplateRequest : PlainRequest +{ + public GetTemplateRequest() + { + } + + public GetTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_template"; + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, the request retrieves information from the local node only. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves information about one or more index templates. +/// +public sealed partial class GetTemplateRequestDescriptor : RequestDescriptor +{ + internal GetTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_template"; + + public GetTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs new file mode 100644 index 00000000000..d2cb8606532 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class GetTemplateResponse : DictionaryResponse +{ + public GetTemplateResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetTemplateResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs new file mode 100644 index 00000000000..7afd4f210e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs @@ -0,0 +1,270 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class IndicesStatsRequestParameters : RequestParameters +{ + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? CompletionFields { get => Q("completion_fields"); set => Q("completion_fields", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? FielddataFields { get => Q("fielddata_fields"); set => Q("fielddata_fields", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in the statistics. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// If true, statistics are not collected from closed indices. + /// + public bool? ForbidClosedIndices { get => Q("forbid_closed_indices"); set => Q("forbid_closed_indices", value); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + public ICollection? Groups { get => Q?>("groups"); set => Q("groups", value); } + + /// + /// If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + /// + public bool? IncludeSegmentFileSizes { get => Q("include_segment_file_sizes"); set => Q("include_segment_file_sizes", value); } + + /// + /// If true, the response includes information from segments that are not loaded into memory. + /// + public bool? IncludeUnloadedSegments { get => Q("include_unloaded_segments"); set => Q("include_unloaded_segments", value); } + + /// + /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// + public Elastic.Clients.Elasticsearch.Serverless.Level? Level { get => Q("level"); set => Q("level", value); } +} + +/// +/// Returns statistics for one or more indices.
For data streams, the API retrieves statistics for the stream’s backing indices.
+///
+public sealed partial class IndicesStatsRequest : PlainRequest +{ + public IndicesStatsRequest() + { + } + + public IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.stats"; + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CompletionFields { get => Q("completion_fields"); set => Q("completion_fields", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? FielddataFields { get => Q("fielddata_fields"); set => Q("fielddata_fields", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in the statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// If true, statistics are not collected from closed indices. + /// + [JsonIgnore] + public bool? ForbidClosedIndices { get => Q("forbid_closed_indices"); set => Q("forbid_closed_indices", value); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + [JsonIgnore] + public ICollection? Groups { get => Q?>("groups"); set => Q("groups", value); } + + /// + /// If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + /// + [JsonIgnore] + public bool? IncludeSegmentFileSizes { get => Q("include_segment_file_sizes"); set => Q("include_segment_file_sizes", value); } + + /// + /// If true, the response includes information from segments that are not loaded into memory. + /// + [JsonIgnore] + public bool? IncludeUnloadedSegments { get => Q("include_unloaded_segments"); set => Q("include_unloaded_segments", value); } + + /// + /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Level? Level { get => Q("level"); set => Q("level", value); } +} + +/// +/// Returns statistics for one or more indices.
For data streams, the API retrieves statistics for the stream’s backing indices.
+///
+public sealed partial class IndicesStatsRequestDescriptor : RequestDescriptor, IndicesStatsRequestParameters> +{ + internal IndicesStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public IndicesStatsRequestDescriptor() + { + } + + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.stats"; + + public IndicesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Serverless.Fields? completionFields) => Qs("completion_fields", completionFields); + public IndicesStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public IndicesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Serverless.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public IndicesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public IndicesStatsRequestDescriptor ForbidClosedIndices(bool? forbidClosedIndices = true) => Qs("forbid_closed_indices", forbidClosedIndices); + public IndicesStatsRequestDescriptor Groups(ICollection? groups) => Qs("groups", groups); + public IndicesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public IndicesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns statistics for one or more indices.
For data streams, the API retrieves statistics for the stream’s backing indices.
+///
+public sealed partial class IndicesStatsRequestDescriptor : RequestDescriptor +{ + internal IndicesStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public IndicesStatsRequestDescriptor() + { + } + + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.stats"; + + public IndicesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Serverless.Fields? completionFields) => Qs("completion_fields", completionFields); + public IndicesStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public IndicesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Serverless.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public IndicesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public IndicesStatsRequestDescriptor ForbidClosedIndices(bool? forbidClosedIndices = true) => Qs("forbid_closed_indices", forbidClosedIndices); + public IndicesStatsRequestDescriptor Groups(ICollection? groups) => Qs("groups", groups); + public IndicesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public IndicesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs new file mode 100644 index 00000000000..79aa69931c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndicesStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndicesStats All { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyDictionary? Indices { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs new file mode 100644 index 00000000000..40512dcd6c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class MigrateToDataStreamRequestParameters : RequestParameters +{ +} + +/// +/// 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.
+///
+public sealed partial class MigrateToDataStreamRequest : PlainRequest +{ + public MigrateToDataStreamRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementMigrateToDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.migrate_to_data_stream"; +} + +/// +/// 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.
+///
+public sealed partial class MigrateToDataStreamRequestDescriptor : RequestDescriptor +{ + internal MigrateToDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public MigrateToDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName name) : base(r => r.Required("name", name)) + { + } + + internal MigrateToDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementMigrateToDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.migrate_to_data_stream"; + + public MigrateToDataStreamRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.IndexName name) + { + RouteValues.Required("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs new file mode 100644 index 00000000000..5a1499fb426 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MigrateToDataStreamResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs new file mode 100644 index 00000000000..0043579750c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class OpenIndexRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Opens a closed index.
For data streams, the API opens any closed backing indices.
+///
+public sealed partial class OpenIndexRequest : PlainRequest +{ + public OpenIndexRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.open"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Opens a closed index.
For data streams, the API opens any closed backing indices.
+///
+public sealed partial class OpenIndexRequestDescriptor : RequestDescriptor, OpenIndexRequestParameters> +{ + internal OpenIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal OpenIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.open"; + + public OpenIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public OpenIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public OpenIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public OpenIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public OpenIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public OpenIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public OpenIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Opens a closed index.
For data streams, the API opens any closed backing indices.
+///
+public sealed partial class OpenIndexRequestDescriptor : RequestDescriptor +{ + internal OpenIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal OpenIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.open"; + + public OpenIndexRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public OpenIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public OpenIndexRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public OpenIndexRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public OpenIndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public OpenIndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public OpenIndexRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs new file mode 100644 index 00000000000..5c5e6895f99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class OpenIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("shards_acknowledged")] + public bool ShardsAcknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs new file mode 100644 index 00000000000..4e1498d483b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs @@ -0,0 +1,415 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class PutAliasRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class PutAliasRequest : PlainRequest +{ + public PutAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_alias"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Query used to limit documents the alias can access. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("index_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRouting { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("is_write_index")] + public bool? IsWriteIndex { get; set; } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("search_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRouting { get; set; } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class PutAliasRequestDescriptor : RequestDescriptor, PutAliasRequestParameters> +{ + internal PutAliasRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal PutAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_alias"; + + public PutAliasRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutAliasRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public PutAliasRequestDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ public PutAliasRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class PutAliasRequestDescriptor : RequestDescriptor +{ + internal PutAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("index", indices).Required("name", name)) + { + } + + internal PutAliasRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_alias"; + + public PutAliasRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutAliasRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public PutAliasRequestDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ public PutAliasRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// 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.
+ ///
+ public PutAliasRequestDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs new file mode 100644 index 00000000000..81793e6e34b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class PutAliasResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs new file mode 100644 index 00000000000..5e35bb00528 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs @@ -0,0 +1,149 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class PutDataLifecycleRequestParameters : RequestParameters +{ + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Update the data lifecycle of the specified data streams. +/// +public sealed partial class PutDataLifecycleRequest : PlainRequest +{ + public PutDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_data_lifecycle"; + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("data_retention")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetention { get; set; } +} + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// Update the data lifecycle of the specified data streams. +/// +public sealed partial class PutDataLifecycleRequestDescriptor : RequestDescriptor +{ + internal PutDataLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) : base(r => r.Required("name", name)) + { + } + + internal PutDataLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutDataLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_data_lifecycle"; + + public PutDataLifecycleRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutDataLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutDataLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutDataLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetentionValue { get; set; } + + /// + /// 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.
+ ///
+ public PutDataLifecycleRequestDescriptor DataRetention(Elastic.Clients.Elasticsearch.Serverless.Duration? dataRetention) + { + DataRetentionValue = dataRetention; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DataRetentionValue is not null) + { + writer.WritePropertyName("data_retention"); + JsonSerializer.Serialize(writer, DataRetentionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs new file mode 100644 index 00000000000..d146e5f0fa0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. +/// +public sealed partial class PutDataLifecycleResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs new file mode 100644 index 00000000000..9c4512b098a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -0,0 +1,526 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class PutIndexTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, this request cannot replace or update existing index templates. + /// + public bool? Create { get => Q("create"); set => Q("create", value); } +} + +/// +/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+///
+public sealed partial class PutIndexTemplateRequest : PlainRequest +{ + public PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_index_template"; + + /// + /// If `true`, this request cannot replace or update existing index templates. + /// + [JsonIgnore] + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// Name of the index template to create. + /// + [JsonInclude, JsonPropertyName("index_patterns")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatterns { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("composed_of")] + public ICollection? ComposedOf { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? Template { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStream { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("priority")] + public int? Priority { get; set; } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } +} + +/// +/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+///
+public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor, PutIndexTemplateRequestParameters> +{ + internal PutIndexTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal PutIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_index_template"; + + public PutIndexTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + + public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } + private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection? ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } + private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } + private int? PriorityValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutIndexTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public PutIndexTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) + { + ComposedOfValue = composedOf; + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public PutIndexTemplateRequestDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template to create. + /// + public PutIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Indices? indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor Priority(int? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public PutIndexTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (TemplateDescriptor is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateDescriptor, options); + } + else if (TemplateDescriptorAction is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (ComposedOfValue is not null) + { + writer.WritePropertyName("composed_of"); + JsonSerializer.Serialize(writer, ComposedOfValue, options); + } + + if (DataStreamDescriptor is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamDescriptor, options); + } + else if (DataStreamDescriptorAction is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (IndexPatternsValue is not null) + { + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+///
+public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor +{ + internal PutIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal PutIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_index_template"; + + public PutIndexTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + + public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } + private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection? ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } + private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } + private int? PriorityValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutIndexTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public PutIndexTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) + { + ComposedOfValue = composedOf; + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public PutIndexTemplateRequestDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template to create. + /// + public PutIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Indices? indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// 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.
+ ///
+ public PutIndexTemplateRequestDescriptor Priority(int? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public PutIndexTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (TemplateDescriptor is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateDescriptor, options); + } + else if (TemplateDescriptorAction is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (ComposedOfValue is not null) + { + writer.WritePropertyName("composed_of"); + JsonSerializer.Serialize(writer, ComposedOfValue, options); + } + + if (DataStreamDescriptor is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamDescriptor, options); + } + else if (DataStreamDescriptorAction is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (IndexPatternsValue is not null) + { + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs new file mode 100644 index 00000000000..3e3324952b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class PutIndexTemplateResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs new file mode 100644 index 00000000000..12486847aba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs @@ -0,0 +1,850 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class PutMappingRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If `true`, the mappings are applied only to the current write index for the target. + /// + public bool? WriteIndexOnly { get => Q("write_index_only"); set => Q("write_index_only", value); } +} + +/// +/// 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.
+///
+public sealed partial class PutMappingRequest : PlainRequest +{ + public PutMappingRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_mapping"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If `true`, the mappings are applied only to the current write index for the target. + /// + [JsonIgnore] + public bool? WriteIndexOnly { get => Q("write_index_only"); set => Q("write_index_only", value); } + + /// + /// Controls whether dynamic date detection is enabled. + /// + [JsonInclude, JsonPropertyName("date_detection")] + public bool? DateDetection { get; set; } + + /// + /// Controls whether new fields are added dynamically. + /// + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("dynamic_date_formats")] + public ICollection? DynamicDateFormats { get; set; } + + /// + /// Specify dynamic templates for the mapping. + /// + [JsonInclude, JsonPropertyName("dynamic_templates"), SingleOrManyCollectionConverter(typeof(IDictionary))] + public ICollection>? DynamicTemplates { get; set; } + + /// + /// Control whether field names are enabled for the index. + /// + [JsonInclude, JsonPropertyName("_field_names")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNames { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// Automatically map strings into numeric data types for all fields. + /// + [JsonInclude, JsonPropertyName("numeric_detection")] + public bool? NumericDetection { get; set; } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + /// + /// Enable making a routing value required on indexed documents. + /// + [JsonInclude, JsonPropertyName("_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? Routing { get; set; } + + /// + /// Control whether the _source field is enabled on the index. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? Source { get; set; } + + /// + /// Mapping of runtime fields for the index. + /// + [JsonInclude, JsonPropertyName("runtime")] + public IDictionary? Runtime { get; set; } +} + +/// +/// 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.
+///
+public sealed partial class PutMappingRequestDescriptor : RequestDescriptor, PutMappingRequestParameters> +{ + internal PutMappingRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal PutMappingRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_mapping"; + + public PutMappingRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutMappingRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutMappingRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutMappingRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutMappingRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public PutMappingRequestDescriptor WriteIndexOnly(bool? writeIndexOnly = true) => Qs("write_index_only", writeIndexOnly); + + public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } + private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } + private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } + private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private bool? DateDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private ICollection? DynamicDateFormatsValue { get; set; } + private ICollection>? DynamicTemplatesValue { get; set; } + private bool? NumericDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary? RuntimeValue { get; set; } + + /// + /// Control whether field names are enabled for the index. + /// + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? fieldNames) + { + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = null; + FieldNamesValue = fieldNames; + return Self; + } + + public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + { + FieldNamesValue = null; + FieldNamesDescriptorAction = null; + FieldNamesDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor FieldNames(Action configure) + { + FieldNamesValue = null; + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public PutMappingRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Enable making a routing value required on indexed documents. + /// + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + /// + /// Control whether the _source field is enabled on the index. + /// + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Controls whether dynamic date detection is enabled. + /// + public PutMappingRequestDescriptor DateDetection(bool? dateDetection = true) + { + DateDetectionValue = dateDetection; + return Self; + } + + /// + /// Controls whether new fields are added dynamically. + /// + public PutMappingRequestDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + /// + /// 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.
+ ///
+ public PutMappingRequestDescriptor DynamicDateFormats(ICollection? dynamicDateFormats) + { + DynamicDateFormatsValue = dynamicDateFormats; + return Self; + } + + /// + /// Specify dynamic templates for the mapping. + /// + public PutMappingRequestDescriptor DynamicTemplates(ICollection>? dynamicTemplates) + { + DynamicTemplatesValue = dynamicTemplates; + return Self; + } + + /// + /// Automatically map strings into numeric data types for all fields. + /// + public PutMappingRequestDescriptor NumericDetection(bool? numericDetection = true) + { + NumericDetectionValue = numericDetection; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Mapping.PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Action> configure) + { + var descriptor = new Mapping.PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Mapping of runtime fields for the index. + /// + public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + { + RuntimeValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldNamesDescriptor is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesDescriptor, options); + } + else if (FieldNamesDescriptorAction is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + } + else if (FieldNamesValue is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SourceDescriptor is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceDescriptor, options); + } + else if (SourceDescriptorAction is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (DateDetectionValue.HasValue) + { + writer.WritePropertyName("date_detection"); + writer.WriteBooleanValue(DateDetectionValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (DynamicDateFormatsValue is not null) + { + writer.WritePropertyName("dynamic_date_formats"); + JsonSerializer.Serialize(writer, DynamicDateFormatsValue, options); + } + + if (DynamicTemplatesValue is not null) + { + writer.WritePropertyName("dynamic_templates"); + SingleOrManySerializationHelper.Serialize>(DynamicTemplatesValue, writer, options); + } + + if (NumericDetectionValue.HasValue) + { + writer.WritePropertyName("numeric_detection"); + writer.WriteBooleanValue(NumericDetectionValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RuntimeValue is not null) + { + writer.WritePropertyName("runtime"); + JsonSerializer.Serialize(writer, RuntimeValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// 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.
+///
+public sealed partial class PutMappingRequestDescriptor : RequestDescriptor +{ + internal PutMappingRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal PutMappingRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_mapping"; + + public PutMappingRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutMappingRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutMappingRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutMappingRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutMappingRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public PutMappingRequestDescriptor WriteIndexOnly(bool? writeIndexOnly = true) => Qs("write_index_only", writeIndexOnly); + + public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } + private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } + private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } + private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private bool? DateDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private ICollection? DynamicDateFormatsValue { get; set; } + private ICollection>? DynamicTemplatesValue { get; set; } + private bool? NumericDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary? RuntimeValue { get; set; } + + /// + /// Control whether field names are enabled for the index. + /// + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? fieldNames) + { + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = null; + FieldNamesValue = fieldNames; + return Self; + } + + public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + { + FieldNamesValue = null; + FieldNamesDescriptorAction = null; + FieldNamesDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor FieldNames(Action configure) + { + FieldNamesValue = null; + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public PutMappingRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Enable making a routing value required on indexed documents. + /// + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + /// + /// Control whether the _source field is enabled on the index. + /// + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutMappingRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Controls whether dynamic date detection is enabled. + /// + public PutMappingRequestDescriptor DateDetection(bool? dateDetection = true) + { + DateDetectionValue = dateDetection; + return Self; + } + + /// + /// Controls whether new fields are added dynamically. + /// + public PutMappingRequestDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + /// + /// 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.
+ ///
+ public PutMappingRequestDescriptor DynamicDateFormats(ICollection? dynamicDateFormats) + { + DynamicDateFormatsValue = dynamicDateFormats; + return Self; + } + + /// + /// Specify dynamic templates for the mapping. + /// + public PutMappingRequestDescriptor DynamicTemplates(ICollection>? dynamicTemplates) + { + DynamicTemplatesValue = dynamicTemplates; + return Self; + } + + /// + /// Automatically map strings into numeric data types for all fields. + /// + public PutMappingRequestDescriptor NumericDetection(bool? numericDetection = true) + { + NumericDetectionValue = numericDetection; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Mapping.PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Mapping for a field. For new fields, this mapping can include: + /// - Field name
- Field data type
- Mapping parameters
+ ///
+ public PutMappingRequestDescriptor Properties(Action> configure) + { + var descriptor = new Mapping.PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Mapping of runtime fields for the index. + /// + public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + { + RuntimeValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldNamesDescriptor is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesDescriptor, options); + } + else if (FieldNamesDescriptorAction is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + } + else if (FieldNamesValue is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SourceDescriptor is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceDescriptor, options); + } + else if (SourceDescriptorAction is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (DateDetectionValue.HasValue) + { + writer.WritePropertyName("date_detection"); + writer.WriteBooleanValue(DateDetectionValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (DynamicDateFormatsValue is not null) + { + writer.WritePropertyName("dynamic_date_formats"); + JsonSerializer.Serialize(writer, DynamicDateFormatsValue, options); + } + + if (DynamicTemplatesValue is not null) + { + writer.WritePropertyName("dynamic_templates"); + SingleOrManySerializationHelper.Serialize>(DynamicTemplatesValue, writer, options); + } + + if (NumericDetectionValue.HasValue) + { + writer.WritePropertyName("numeric_detection"); + writer.WriteBooleanValue(NumericDetectionValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RuntimeValue is not null) + { + writer.WritePropertyName("runtime"); + JsonSerializer.Serialize(writer, RuntimeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs new file mode 100644 index 00000000000..249d7c4ad4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class PutMappingResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs new file mode 100644 index 00000000000..67253030a5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -0,0 +1,301 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class PutTemplateRequestParameters : RequestParameters +{ + /// + /// If true, this request cannot replace or update existing index templates. + /// + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+///
+public sealed partial class PutTemplateRequest : PlainRequest +{ + public PutTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_template"; + + /// + /// If true, this request cannot replace or update existing index templates. + /// + [JsonIgnore] + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Aliases for the index. + /// + [JsonInclude, JsonPropertyName("aliases")] + public IDictionary? Aliases { get; set; } + + /// + /// Array of wildcard expressions used to match the names
of indices during creation.
+ ///
+ [JsonInclude, JsonPropertyName("index_patterns"), SingleOrManyCollectionConverter(typeof(string))] + public ICollection? IndexPatterns { get; set; } + + /// + /// Mapping for fields in the index. + /// + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("order")] + public int? Order { get; set; } + + /// + /// Configuration options for the index. + /// + [JsonInclude, JsonPropertyName("settings")] + public IDictionary? Settings { get; set; } + + /// + /// Version number used to manage index templates externally. This number
is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } +} + +/// +/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+///
+public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor +{ + internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal PutTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_template"; + + public PutTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public PutTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public PutTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private IDictionary? AliasesValue { get; set; } + private ICollection? IndexPatternsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private int? OrderValue { get; set; } + private IDictionary? SettingsValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Aliases for the index. + /// + public PutTemplateRequestDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Array of wildcard expressions used to match the names
of indices during creation.
+ ///
+ public PutTemplateRequestDescriptor IndexPatterns(ICollection? indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// Mapping for fields in the index. + /// + public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public PutTemplateRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public PutTemplateRequestDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public PutTemplateRequestDescriptor Order(int? order) + { + OrderValue = order; + return Self; + } + + /// + /// Configuration options for the index. + /// + public PutTemplateRequestDescriptor Settings(Func, FluentDictionary> selector) + { + SettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Version number used to manage index templates externally. This number
is not automatically generated by Elasticsearch.
+ ///
+ public PutTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (IndexPatternsValue is not null) + { + writer.WritePropertyName("index_patterns"); + SingleOrManySerializationHelper.Serialize(IndexPatternsValue, writer, options); + } + + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (OrderValue.HasValue) + { + writer.WritePropertyName("order"); + writer.WriteNumberValue(OrderValue.Value); + } + + if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs new file mode 100644 index 00000000000..4e91eb27543 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class PutTemplateResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs new file mode 100644 index 00000000000..84127702c6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -0,0 +1,299 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class RolloverRequestParameters : RequestParameters +{ + /// + /// If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. + /// + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Creates a new index for a data stream or index alias. +/// +public sealed partial class RolloverRequest : PlainRequest +{ + public RolloverRequest(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) : base(r => r.Required("alias", alias)) + { + } + + public RolloverRequest(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Elastic.Clients.Elasticsearch.Serverless.IndexName? new_index) : base(r => r.Required("alias", alias).Optional("new_index", new_index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRollover; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.rollover"; + + /// + /// If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. + /// + [JsonIgnore] + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// 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`).
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Aliases for the target index.
Data streams do not support this parameter.
+ ///
+ [JsonInclude, JsonPropertyName("aliases")] + public IDictionary? Aliases { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("conditions")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditions? Conditions { get; set; } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping paramaters.
+ ///
+ [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } + + /// + /// Configuration options for the index.
Data streams do not support this parameter.
+ ///
+ [JsonInclude, JsonPropertyName("settings")] + public IDictionary? Settings { get; set; } +} + +/// +/// Creates a new index for a data stream or index alias. +/// +public sealed partial class RolloverRequestDescriptor : RequestDescriptor +{ + internal RolloverRequestDescriptor(Action configure) => configure.Invoke(this); + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) : base(r => r.Required("alias", alias)) + { + } + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Elastic.Clients.Elasticsearch.Serverless.IndexName? new_index) : base(r => r.Required("alias", alias).Optional("new_index", new_index)) + { + } + + internal RolloverRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRollover; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.rollover"; + + public RolloverRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun); + public RolloverRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RolloverRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public RolloverRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public RolloverRequestDescriptor Alias(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) + { + RouteValues.Required("alias", alias); + return Self; + } + + public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.Serverless.IndexName? new_index) + { + RouteValues.Optional("new_index", new_index); + return Self; + } + + private IDictionary? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditions? ConditionsValue { get; set; } + private RolloverConditionsDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private IDictionary? SettingsValue { get; set; } + + /// + /// Aliases for the target index.
Data streams do not support this parameter.
+ ///
+ public RolloverRequestDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// 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.
+ ///
+ public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditions? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsValue = conditions; + return Self; + } + + public RolloverRequestDescriptor Conditions(RolloverConditionsDescriptor descriptor) + { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptor = descriptor; + return Self; + } + + public RolloverRequestDescriptor Conditions(Action configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorAction = configure; + return Self; + } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping paramaters.
+ ///
+ public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public RolloverRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public RolloverRequestDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index.
Data streams do not support this parameter.
+ ///
+ public RolloverRequestDescriptor Settings(Func, FluentDictionary> selector) + { + SettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (ConditionsDescriptor is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsDescriptor, options); + } + else if (ConditionsDescriptorAction is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, new RolloverConditionsDescriptor(ConditionsDescriptorAction), options); + } + else if (ConditionsValue is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsValue, options); + } + + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs new file mode 100644 index 00000000000..61018e4ce16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class RolloverResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("conditions")] + public IReadOnlyDictionary Conditions { get; init; } + [JsonInclude, JsonPropertyName("dry_run")] + public bool DryRun { get; init; } + [JsonInclude, JsonPropertyName("new_index")] + public string NewIndex { get; init; } + [JsonInclude, JsonPropertyName("old_index")] + public string OldIndex { get; init; } + [JsonInclude, JsonPropertyName("rolled_over")] + public bool RolledOver { get; init; } + [JsonInclude, JsonPropertyName("shards_acknowledged")] + public bool ShardsAcknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs new file mode 100644 index 00000000000..59c698d6c23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -0,0 +1,581 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class SimulateIndexTemplateRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +public sealed partial class SimulateIndexTemplateRequest : PlainRequest +{ + public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.simulate_index_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.
+ ///
+ [JsonIgnore] + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("allow_auto_create")] + public bool? AllowAutoCreate { get; set; } + + /// + /// Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. + /// + [JsonInclude, JsonPropertyName("index_patterns")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatterns { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("composed_of")] + public ICollection? ComposedOf { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? Template { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStream { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("priority")] + public int? Priority { get; set; } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } +} + +public sealed partial class SimulateIndexTemplateRequestDescriptor : RequestDescriptor, SimulateIndexTemplateRequestParameters> +{ + internal SimulateIndexTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal SimulateIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.simulate_index_template"; + + public SimulateIndexTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public SimulateIndexTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public SimulateIndexTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } + private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? AllowAutoCreateValue { get; set; } + private ICollection? ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } + private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } + private int? PriorityValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) + { + ComposedOfValue = composedOf; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. + /// + public SimulateIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Indices? indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Priority(int? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (TemplateDescriptor is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateDescriptor, options); + } + else if (TemplateDescriptorAction is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (ComposedOfValue is not null) + { + writer.WritePropertyName("composed_of"); + JsonSerializer.Serialize(writer, ComposedOfValue, options); + } + + if (DataStreamDescriptor is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamDescriptor, options); + } + else if (DataStreamDescriptorAction is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (IndexPatternsValue is not null) + { + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SimulateIndexTemplateRequestDescriptor : RequestDescriptor +{ + internal SimulateIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal SimulateIndexTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.simulate_index_template"; + + public SimulateIndexTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public SimulateIndexTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public SimulateIndexTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } + private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? AllowAutoCreateValue { get; set; } + private ICollection? ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } + private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } + private int? PriorityValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Optional user metadata about the index template.
May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) + { + ComposedOfValue = composedOf; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibility? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. + /// + public SimulateIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Indices? indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// 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.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Priority(int? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public SimulateIndexTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (TemplateDescriptor is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateDescriptor, options); + } + else if (TemplateDescriptorAction is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (ComposedOfValue is not null) + { + writer.WritePropertyName("composed_of"); + JsonSerializer.Serialize(writer, ComposedOfValue, options); + } + + if (DataStreamDescriptor is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamDescriptor, options); + } + else if (DataStreamDescriptorAction is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (IndexPatternsValue is not null) + { + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs new file mode 100644 index 00000000000..a5c1da3114e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs @@ -0,0 +1,30 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SimulateIndexTemplateResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs new file mode 100644 index 00000000000..a2cfb585ae1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class SimulateTemplateRequestParameters : RequestParameters +{ + /// + /// 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. + /// + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Returns the index configuration that would be applied by a particular index template. +/// +public sealed partial class SimulateTemplateRequest : PlainRequest +{ + public SimulateTemplateRequest() + { + } + + public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.simulate_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. + /// + [JsonIgnore] + public bool? Create { get => Q("create"); set => Q("create", value); } + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If true, returns all relevant default configurations for the index template. + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } +} + +/// +/// Returns the index configuration that would be applied by a particular index template. +/// +public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor +{ + internal SimulateTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public SimulateTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.simulate_template"; + + public SimulateTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public SimulateTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public SimulateTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SimulateTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs new file mode 100644 index 00000000000..3440141f043 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SimulateTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("overlapping")] + public IReadOnlyCollection? Overlapping { get; init; } + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Template Template { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs new file mode 100644 index 00000000000..f41da154db8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs @@ -0,0 +1,283 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed class UpdateAliasesRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class UpdateAliasesRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementUpdateAliases; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.update_aliases"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Actions to perform. + /// + [JsonInclude, JsonPropertyName("actions")] + public ICollection? Actions { get; set; } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class UpdateAliasesRequestDescriptor : RequestDescriptor, UpdateAliasesRequestParameters> +{ + internal UpdateAliasesRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateAliasesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementUpdateAliases; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.update_aliases"; + + public UpdateAliasesRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public UpdateAliasesRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + private ICollection? ActionsValue { get; set; } + private ActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } + + /// + /// Actions to perform. + /// + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsValue = actions; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(ActionDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsDescriptor = descriptor; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorActions = null; + ActionsDescriptorAction = configure; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(params Action[] configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsDescriptor is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ActionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorAction is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorActions is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + foreach (var action in ActionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Adds a data stream or index to an alias. +/// +public sealed partial class UpdateAliasesRequestDescriptor : RequestDescriptor +{ + internal UpdateAliasesRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateAliasesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementUpdateAliases; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.update_aliases"; + + public UpdateAliasesRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public UpdateAliasesRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + private ICollection? ActionsValue { get; set; } + private ActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } + + /// + /// Actions to perform. + /// + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsValue = actions; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(ActionDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsDescriptor = descriptor; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorActions = null; + ActionsDescriptorAction = configure; + return Self; + } + + public UpdateAliasesRequestDescriptor Actions(params Action[] configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsDescriptor is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ActionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorAction is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorActions is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + foreach (var action in ActionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs new file mode 100644 index 00000000000..50663a85e52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class UpdateAliasesResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs new file mode 100644 index 00000000000..a4aca113e8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs @@ -0,0 +1,247 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class IndexRequestParameters : RequestParameters +{ + /// + /// only perform the index operation if the last operation that has changed the document has the specified primary term + /// + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// only perform the index operation if the last operation that has changed the document has the specified sequence number + /// + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID + /// + public Elastic.Clients.Elasticsearch.Serverless.OpType? OpType { get => Q("op_type"); set => Q("op_type", value); } + + /// + /// The pipeline id to preprocess incoming documents with + /// + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// When true, requires destination to be an alias. Default is false + /// + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } +} + +/// +/// Creates or updates a document in an index. +/// +public sealed partial class IndexRequest : PlainRequest +{ + public IndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) + { + } + + public IndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "index"; + + [JsonIgnore] + public TDocument Document { get; set; } + + /// + /// only perform the index operation if the last operation that has changed the document has the specified primary term + /// + [JsonIgnore] + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// only perform the index operation if the last operation that has changed the document has the specified sequence number + /// + [JsonIgnore] + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.OpType? OpType { get => Q("op_type"); set => Q("op_type", value); } + + /// + /// The pipeline id to preprocess incoming documents with + /// + [JsonIgnore] + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// When true, requires destination to be an alias. Default is false + /// + [JsonIgnore] + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } +} + +/// +/// Creates or updates a document in an index. +/// +public sealed partial class IndexRequestDescriptor : RequestDescriptor, IndexRequestParameters> +{ + internal IndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + internal IndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) + { + } + + public IndexRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) => DocumentValue = document; + public IndexRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) => DocumentValue = document; + public IndexRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) => DocumentValue = document; + public IndexRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) => DocumentValue = document; + + public IndexRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + public IndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal IndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "index"; + + public IndexRequestDescriptor IfPrimaryTerm(long? ifPrimaryTerm) => Qs("if_primary_term", ifPrimaryTerm); + public IndexRequestDescriptor IfSeqNo(long? ifSeqNo) => Qs("if_seq_no", ifSeqNo); + public IndexRequestDescriptor OpType(Elastic.Clients.Elasticsearch.Serverless.OpType? opType) => Qs("op_type", opType); + public IndexRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public IndexRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public IndexRequestDescriptor RequireAlias(bool? requireAlias = true) => Qs("require_alias", requireAlias); + public IndexRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public IndexRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public IndexRequestDescriptor Version(long? version) => Qs("version", version); + public IndexRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + public IndexRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public IndexRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + public IndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private TDocument DocumentValue { get; set; } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs new file mode 100644 index 00000000000..1eeb09c52ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class IndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoRequest.g.cs new file mode 100644 index 00000000000..a2e7a10a48e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class InfoRequestParameters : RequestParameters +{ +} + +/// +/// Returns basic information about the cluster. +/// +public sealed partial class InfoRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "info"; +} + +/// +/// Returns basic information about the cluster. +/// +public sealed partial class InfoRequestDescriptor : RequestDescriptor +{ + internal InfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public InfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "info"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs new file mode 100644 index 00000000000..0eef36535e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class InfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("cluster_uuid")] + public string ClusterUuid { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("tagline")] + public string Tagline { get; init; } + [JsonInclude, JsonPropertyName("version")] + public Elastic.Clients.Elasticsearch.Serverless.ElasticsearchVersionInfo Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs new file mode 100644 index 00000000000..7760599c8cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs @@ -0,0 +1,147 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class DeletePipelineRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes one or more existing ingest pipeline. +/// +public sealed partial class DeletePipelineRequest : PlainRequest +{ + public DeletePipelineRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_pipeline"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes one or more existing ingest pipeline. +/// +public sealed partial class DeletePipelineRequestDescriptor : RequestDescriptor, DeletePipelineRequestParameters> +{ + internal DeletePipelineRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeletePipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_pipeline"; + + public DeletePipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeletePipelineRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeletePipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes one or more existing ingest pipeline. +/// +public sealed partial class DeletePipelineRequestDescriptor : RequestDescriptor +{ + internal DeletePipelineRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal DeletePipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_pipeline"; + + public DeletePipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeletePipelineRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeletePipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs new file mode 100644 index 00000000000..9ed212dbfd2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DeletePipelineResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs new file mode 100644 index 00000000000..b507d736121 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class GeoIpStatsRequestParameters : RequestParameters +{ +} + +/// +/// Gets download statistics for GeoIP2 databases used with the geoip processor. +/// +public sealed partial class GeoIpStatsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestGeoIpStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.geo_ip_stats"; +} + +/// +/// Gets download statistics for GeoIP2 databases used with the geoip processor. +/// +public sealed partial class GeoIpStatsRequestDescriptor : RequestDescriptor +{ + internal GeoIpStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GeoIpStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestGeoIpStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.geo_ip_stats"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs new file mode 100644 index 00000000000..98baeee29ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GeoIpStatsResponse : ElasticsearchResponse +{ + /// + /// Downloaded GeoIP2 databases for each node. + /// + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Download statistics for all GeoIP2 databases. + /// + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpDownloadStatistics Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs new file mode 100644 index 00000000000..5790f3828db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class GetPipelineRequestParameters : RequestParameters +{ + /// + /// 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.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Return pipelines without their definitions (default: false) + /// + public bool? Summary { get => Q("summary"); set => Q("summary", value); } +} + +/// +/// Returns information about one or more ingest pipelines.
This API returns a local reference of the pipeline.
+///
+public sealed partial class GetPipelineRequest : PlainRequest +{ + public GetPipelineRequest() + { + } + + public GetPipelineRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestGetPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.get_pipeline"; + + /// + /// 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.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Return pipelines without their definitions (default: false) + /// + [JsonIgnore] + public bool? Summary { get => Q("summary"); set => Q("summary", value); } +} + +/// +/// Returns information about one or more ingest pipelines.
This API returns a local reference of the pipeline.
+///
+public sealed partial class GetPipelineRequestDescriptor : RequestDescriptor, GetPipelineRequestParameters> +{ + internal GetPipelineRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetPipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestGetPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.get_pipeline"; + + public GetPipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetPipelineRequestDescriptor Summary(bool? summary = true) => Qs("summary", summary); + + public GetPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about one or more ingest pipelines.
This API returns a local reference of the pipeline.
+///
+public sealed partial class GetPipelineRequestDescriptor : RequestDescriptor +{ + internal GetPipelineRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetPipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestGetPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.get_pipeline"; + + public GetPipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetPipelineRequestDescriptor Summary(bool? summary = true) => Qs("summary", summary); + + public GetPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineResponse.g.cs new file mode 100644 index 00000000000..489c01f2f17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineResponse.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GetPipelineResponse : DictionaryResponse +{ + public GetPipelineResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetPipelineResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs new file mode 100644 index 00000000000..fd80c142cf6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class ProcessorGrokRequestParameters : RequestParameters +{ +} + +/// +/// Extracts structured fields out of a single text field within a document.
You choose which field to extract matched fields from, as well as the grok pattern you expect will match.
A grok pattern is like a regular expression that supports aliased expressions that can be reused.
+///
+public sealed partial class ProcessorGrokRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestProcessorGrok; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.processor_grok"; +} + +/// +/// Extracts structured fields out of a single text field within a document.
You choose which field to extract matched fields from, as well as the grok pattern you expect will match.
A grok pattern is like a regular expression that supports aliased expressions that can be reused.
+///
+public sealed partial class ProcessorGrokRequestDescriptor : RequestDescriptor +{ + internal ProcessorGrokRequestDescriptor(Action configure) => configure.Invoke(this); + + public ProcessorGrokRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestProcessorGrok; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.processor_grok"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs new file mode 100644 index 00000000000..ac4cbd8b13d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class ProcessorGrokResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("patterns")] + public IReadOnlyDictionary Patterns { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs new file mode 100644 index 00000000000..27e931b2553 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs @@ -0,0 +1,588 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class PutPipelineRequestParameters : RequestParameters +{ + /// + /// 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. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Required version for optimistic concurrency control for pipeline updates + /// + public long? IfVersion { get => Q("if_version"); set => Q("if_version", value); } +} + +/// +/// Creates or updates an ingest pipeline.
Changes made using this API take effect immediately.
+///
+public sealed partial class PutPipelineRequest : PlainRequest +{ + public PutPipelineRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_pipeline"; + + /// + /// 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. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Required version for optimistic concurrency control for pipeline updates + /// + [JsonIgnore] + public long? IfVersion { get => Q("if_version"); set => Q("if_version", value); } + + /// + /// Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// Description of the ingest pipeline. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. + /// + [JsonInclude, JsonPropertyName("processors")] + public ICollection? Processors { get; set; } + + /// + /// Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. + /// + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } +} + +/// +/// Creates or updates an ingest pipeline.
Changes made using this API take effect immediately.
+///
+public sealed partial class PutPipelineRequestDescriptor : RequestDescriptor, PutPipelineRequestParameters> +{ + internal PutPipelineRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal PutPipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_pipeline"; + + public PutPipelineRequestDescriptor IfVersion(long? ifVersion) => Qs("if_version", ifVersion); + public PutPipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutPipelineRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private ICollection? ProcessorsValue { get; set; } + private ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } + private IDictionary? MetaValue { get; set; } + private string? DescriptionValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. + /// + public PutPipelineRequestDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. + /// + public PutPipelineRequestDescriptor Processors(ICollection? processors) + { + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsValue = processors; + return Self; + } + + public PutPipelineRequestDescriptor Processors(ProcessorDescriptor descriptor) + { + ProcessorsValue = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptor = descriptor; + return Self; + } + + public PutPipelineRequestDescriptor Processors(Action> configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptorAction = configure; + return Self; + } + + public PutPipelineRequestDescriptor Processors(params Action>[] configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. + /// + public PutPipelineRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Description of the ingest pipeline. + /// + public PutPipelineRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. + /// + public PutPipelineRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorsDescriptor is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + foreach (var action in ProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ProcessorsValue is not null) + { + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates an ingest pipeline.
Changes made using this API take effect immediately.
+///
+public sealed partial class PutPipelineRequestDescriptor : RequestDescriptor +{ + internal PutPipelineRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal PutPipelineRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_pipeline"; + + public PutPipelineRequestDescriptor IfVersion(long? ifVersion) => Qs("if_version", ifVersion); + public PutPipelineRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutPipelineRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private ICollection? ProcessorsValue { get; set; } + private ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } + private IDictionary? MetaValue { get; set; } + private string? DescriptionValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. + /// + public PutPipelineRequestDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PutPipelineRequestDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. + /// + public PutPipelineRequestDescriptor Processors(ICollection? processors) + { + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsValue = processors; + return Self; + } + + public PutPipelineRequestDescriptor Processors(ProcessorDescriptor descriptor) + { + ProcessorsValue = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptor = descriptor; + return Self; + } + + public PutPipelineRequestDescriptor Processors(Action configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptorAction = configure; + return Self; + } + + public PutPipelineRequestDescriptor Processors(params Action[] configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. + /// + public PutPipelineRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Description of the ingest pipeline. + /// + public PutPipelineRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. + /// + public PutPipelineRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorsDescriptor is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + foreach (var action in ProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ProcessorsValue is not null) + { + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs new file mode 100644 index 00000000000..3c2bae1ffa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class PutPipelineResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs new file mode 100644 index 00000000000..1b7c5a33517 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -0,0 +1,388 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed class SimulateRequestParameters : RequestParameters +{ + /// + /// If `true`, the response includes output data for each processor in the executed pipeline. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Executes an ingest pipeline against a set of provided documents. +/// +public sealed partial class SimulateRequest : PlainRequest +{ + public SimulateRequest() + { + } + + public SimulateRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestSimulate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.simulate"; + + /// + /// If `true`, the response includes output data for each processor in the executed pipeline. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } + + /// + /// Sample documents to test in the pipeline. + /// + [JsonInclude, JsonPropertyName("docs")] + public ICollection? Docs { get; set; } + + /// + /// Pipeline to test.
If you don’t specify the `pipeline` request path parameter, this parameter is required.
If you specify both this and the request path parameter, the API only uses the request path parameter.
+ ///
+ [JsonInclude, JsonPropertyName("pipeline")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? Pipeline { get; set; } +} + +/// +/// Executes an ingest pipeline against a set of provided documents. +/// +public sealed partial class SimulateRequestDescriptor : RequestDescriptor, SimulateRequestParameters> +{ + internal SimulateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SimulateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestSimulate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.simulate"; + + public SimulateRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? PipelineValue { get; set; } + private PipelineDescriptor PipelineDescriptor { get; set; } + private Action> PipelineDescriptorAction { get; set; } + private ICollection? DocsValue { get; set; } + private DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + + /// + /// Pipeline to test.
If you don’t specify the `pipeline` request path parameter, this parameter is required.
If you specify both this and the request path parameter, the API only uses the request path parameter.
+ ///
+ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? pipeline) + { + PipelineDescriptor = null; + PipelineDescriptorAction = null; + PipelineValue = pipeline; + return Self; + } + + public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + { + PipelineValue = null; + PipelineDescriptorAction = null; + PipelineDescriptor = descriptor; + return Self; + } + + public SimulateRequestDescriptor Pipeline(Action> configure) + { + PipelineValue = null; + PipelineDescriptor = null; + PipelineDescriptorAction = configure; + return Self; + } + + /// + /// Sample documents to test in the pipeline. + /// + public SimulateRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public SimulateRequestDescriptor Docs(DocumentDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public SimulateRequestDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public SimulateRequestDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PipelineDescriptor is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, PipelineDescriptor, options); + } + else if (PipelineDescriptorAction is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + } + else if (PipelineValue is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, PipelineValue, options); + } + + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Executes an ingest pipeline against a set of provided documents. +/// +public sealed partial class SimulateRequestDescriptor : RequestDescriptor +{ + internal SimulateRequestDescriptor(Action configure) => configure.Invoke(this); + + public SimulateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestSimulate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.simulate"; + + public SimulateRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? PipelineValue { get; set; } + private PipelineDescriptor PipelineDescriptor { get; set; } + private Action PipelineDescriptorAction { get; set; } + private ICollection? DocsValue { get; set; } + private DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + + /// + /// Pipeline to test.
If you don’t specify the `pipeline` request path parameter, this parameter is required.
If you specify both this and the request path parameter, the API only uses the request path parameter.
+ ///
+ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? pipeline) + { + PipelineDescriptor = null; + PipelineDescriptorAction = null; + PipelineValue = pipeline; + return Self; + } + + public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + { + PipelineValue = null; + PipelineDescriptorAction = null; + PipelineDescriptor = descriptor; + return Self; + } + + public SimulateRequestDescriptor Pipeline(Action configure) + { + PipelineValue = null; + PipelineDescriptor = null; + PipelineDescriptorAction = configure; + return Self; + } + + /// + /// Sample documents to test in the pipeline. + /// + public SimulateRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public SimulateRequestDescriptor Docs(DocumentDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public SimulateRequestDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public SimulateRequestDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PipelineDescriptor is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, PipelineDescriptor, options); + } + else if (PipelineDescriptorAction is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + } + else if (PipelineValue is not null) + { + writer.WritePropertyName("pipeline"); + JsonSerializer.Serialize(writer, PipelineValue, options); + } + + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs new file mode 100644 index 00000000000..dc6fe27e1cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class SimulateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("docs")] + public IReadOnlyCollection Docs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs new file mode 100644 index 00000000000..e06bc1bfed7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs @@ -0,0 +1,419 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class MultiGetRequestParameters : RequestParameters +{ + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// If `true`, the request is real-time as opposed to near-real-time. + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If `true`, the request refreshes relevant shards before retrieving documents. + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the `_source` field or not, or a list of fields to return. + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude from the response.
You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response.
If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// If `true`, retrieves the document fields stored in the index rather than the document `_source`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } +} + +/// +/// Allows to get multiple documents in one request. +/// +public sealed partial class MultiGetRequest : PlainRequest +{ + public MultiGetRequest() + { + } + + public MultiGetRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mget"; + + /// + /// Specifies the node or shard the operation should be performed on. Random by default. + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// If `true`, the request is real-time as opposed to near-real-time. + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// If `true`, the request refreshes relevant shards before retrieving documents. + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// True or false to return the `_source` field or not, or a list of fields to return. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? Source { get => Q("_source"); set => Q("_source", value); } + + /// + /// A comma-separated list of source fields to exclude from the response.
You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response.
If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// If `true`, retrieves the document fields stored in the index rather than the document `_source`. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } + + /// + /// The documents you want to retrieve. Required if no index is specified in the request URI. + /// + [JsonInclude, JsonPropertyName("docs")] + public ICollection? Docs { get; set; } + + /// + /// The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. + /// + [JsonInclude, JsonPropertyName("ids")] + public Elastic.Clients.Elasticsearch.Serverless.Ids? Ids { get; set; } +} + +/// +/// Allows to get multiple documents in one request. +/// +public sealed partial class MultiGetRequestDescriptor : RequestDescriptor, MultiGetRequestParameters> +{ + internal MultiGetRequestDescriptor(Action> configure) => configure.Invoke(this); + + public MultiGetRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mget"; + + public MultiGetRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public MultiGetRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public MultiGetRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public MultiGetRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public MultiGetRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public MultiGetRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public MultiGetRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiGetRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + + public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private ICollection? DocsValue { get; set; } + private Core.MGet.MultiGetOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ids? IdsValue { get; set; } + + /// + /// The documents you want to retrieve. Required if no index is specified in the request URI. + /// + public MultiGetRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public MultiGetRequestDescriptor Docs(Core.MGet.MultiGetOperationDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public MultiGetRequestDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public MultiGetRequestDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + /// + /// The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. + /// + public MultiGetRequestDescriptor Ids(Elastic.Clients.Elasticsearch.Serverless.Ids? ids) + { + IdsValue = ids; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + if (IdsValue is not null) + { + writer.WritePropertyName("ids"); + JsonSerializer.Serialize(writer, IdsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Allows to get multiple documents in one request. +/// +public sealed partial class MultiGetRequestDescriptor : RequestDescriptor +{ + internal MultiGetRequestDescriptor(Action configure) => configure.Invoke(this); + + public MultiGetRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mget"; + + public MultiGetRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfigParam? source) => Qs("_source", source); + public MultiGetRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public MultiGetRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public MultiGetRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public MultiGetRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public MultiGetRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public MultiGetRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiGetRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) => Qs("stored_fields", storedFields); + + public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private ICollection? DocsValue { get; set; } + private Core.MGet.MultiGetOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ids? IdsValue { get; set; } + + /// + /// The documents you want to retrieve. Required if no index is specified in the request URI. + /// + public MultiGetRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public MultiGetRequestDescriptor Docs(Core.MGet.MultiGetOperationDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public MultiGetRequestDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public MultiGetRequestDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + /// + /// The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. + /// + public MultiGetRequestDescriptor Ids(Elastic.Clients.Elasticsearch.Serverless.Ids? ids) + { + IdsValue = ids; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + if (IdsValue is not null) + { + writer.WritePropertyName("ids"); + JsonSerializer.Serialize(writer, IdsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs new file mode 100644 index 00000000000..6170c5b757a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class MultiGetResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("docs")] + public IReadOnlyCollection> Docs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs new file mode 100644 index 00000000000..dab7b8b7d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs @@ -0,0 +1,358 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class MultiSearchRequestParameters : RequestParameters +{ + /// + /// 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. + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. + /// + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// 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. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// If true, missing or closed indices are not included in the response. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Maximum number of concurrent searches the multi search API can execute. + /// + public long? MaxConcurrentSearches { get => Q("max_concurrent_searches"); set => Q("max_concurrent_searches", value); } + + /// + /// Maximum number of concurrent shard requests that each sub-search request executes per node. + /// + public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + + /// + /// Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. + /// + public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + /// + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Custom routing value used to route search operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Indicates whether global term and document frequencies should be used when scoring returned documents. + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } +} + +/// +/// Allows to execute several search operations in one request. +/// +public sealed partial class MultiSearchRequest : PlainRequest, IStreamSerializable +{ + public MultiSearchRequest() + { + } + + public MultiSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch"; + + /// + /// 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. + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. + /// + [JsonIgnore] + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// 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. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + [JsonIgnore] + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// If true, missing or closed indices are not included in the response. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Maximum number of concurrent searches the multi search API can execute. + /// + [JsonIgnore] + public long? MaxConcurrentSearches { get => Q("max_concurrent_searches"); set => Q("max_concurrent_searches", value); } + + /// + /// Maximum number of concurrent shard requests that each sub-search request executes per node. + /// + [JsonIgnore] + public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + + /// + /// Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. + /// + [JsonIgnore] + public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + /// + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Custom routing value used to route search operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Indicates whether global term and document frequencies should be used when scoring returned documents. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + public List Searches { get; set; } + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (Searches is null) + return; + foreach (var item in Searches) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (Searches is null) + return; + foreach (var item in Searches) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } +} + +/// +/// Allows to execute several search operations in one request. +/// +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, MultiSearchRequestParameters>, IStreamSerializable +{ + internal MultiSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public MultiSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch"; + + public MultiSearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public MultiSearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public MultiSearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public MultiSearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public MultiSearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public MultiSearchRequestDescriptor MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches); + public MultiSearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public MultiSearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public MultiSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public MultiSearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public MultiSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public MultiSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + + List _items = new(); + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } + + public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + { + _items.Add(search); + return this; + } +} + +/// +/// Allows to execute several search operations in one request. +/// +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, IStreamSerializable +{ + internal MultiSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public MultiSearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch"; + + public MultiSearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public MultiSearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public MultiSearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public MultiSearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public MultiSearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public MultiSearchRequestDescriptor MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches); + public MultiSearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public MultiSearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public MultiSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public MultiSearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public MultiSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public MultiSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + + List _items = new(); + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } + + public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + { + _items.Add(search); + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs new file mode 100644 index 00000000000..04a419f5dc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class MultiSearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("responses")] + public IReadOnlyCollection> Responses { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs new file mode 100644 index 00000000000..7f38b51b35a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs @@ -0,0 +1,267 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class MultiSearchTemplateRequestParameters : RequestParameters +{ + /// + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + /// + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// Controls the maximum number of concurrent searches the multi search api will execute + /// + public long? MaxConcurrentSearches { get => Q("max_concurrent_searches"); set => Q("max_concurrent_searches", value); } + + /// + /// Search operation type + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Indicates whether hits.total should be rendered as an integer or an object in the rest search response + /// + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } +} + +/// +/// Runs multiple templated searches with a single request. +/// +public sealed partial class MultiSearchTemplateRequest : PlainRequest, IStreamSerializable +{ + public MultiSearchTemplateRequest() + { + } + + public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch_template"; + + /// + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + /// + [JsonIgnore] + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// Controls the maximum number of concurrent searches the multi search api will execute + /// + [JsonIgnore] + public long? MaxConcurrentSearches { get => Q("max_concurrent_searches"); set => Q("max_concurrent_searches", value); } + + /// + /// Search operation type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Indicates whether hits.total should be rendered as an integer or an object in the rest search response + /// + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + public List SearchTemplates { get; set; } + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (SearchTemplates is null) + return; + foreach (var item in SearchTemplates) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (SearchTemplates is null) + return; + foreach (var item in SearchTemplates) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } +} + +/// +/// Runs multiple templated searches with a single request. +/// +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, MultiSearchTemplateRequestParameters>, IStreamSerializable +{ + internal MultiSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public MultiSearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch_template"; + + public MultiSearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public MultiSearchTemplateRequestDescriptor MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches); + public MultiSearchTemplateRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public MultiSearchTemplateRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public MultiSearchTemplateRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public MultiSearchTemplateRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + + List _items = new(); + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } + + public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + { + _items.Add(item); + return this; + } +} + +/// +/// Runs multiple templated searches with a single request. +/// +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, IStreamSerializable +{ + internal MultiSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public MultiSearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "msearch_template"; + + public MultiSearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public MultiSearchTemplateRequestDescriptor MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches); + public MultiSearchTemplateRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public MultiSearchTemplateRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public MultiSearchTemplateRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public MultiSearchTemplateRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + + List _items = new(); + + void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + serializable.Serialize(stream, settings, formatting); + } + } + + async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) + { + if (_items is null) + return; + foreach (var item in _items) + { + if (item is IStreamSerializable serializable) + await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false); + } + } + + public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + { + _items.Add(item); + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs new file mode 100644 index 00000000000..6b54d68f7fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class MultiSearchTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("responses")] + public IReadOnlyCollection> Responses { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs new file mode 100644 index 00000000000..00b097d9ccc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -0,0 +1,438 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class MultiTermVectorsRequestParameters : RequestParameters +{ + /// + /// A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public bool? FieldStatistics { get => Q("field_statistics"); set => Q("field_statistics", value); } + + /// + /// Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public bool? Offsets { get => Q("offsets"); set => Q("offsets", value); } + + /// + /// Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public bool? Payloads { get => Q("payloads"); set => Q("payloads", value); } + + /// + /// Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public bool? Positions { get => Q("positions"); set => Q("positions", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specifies if requests are real-time as opposed to near-real-time (default: true). + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + public bool? TermStatistics { get => Q("term_statistics"); set => Q("term_statistics", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns multiple termvectors in one request. +/// +public sealed partial class MultiTermVectorsRequest : PlainRequest +{ + public MultiTermVectorsRequest() + { + } + + public MultiTermVectorsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMtermvectors; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mtermvectors"; + + /// + /// A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public bool? FieldStatistics { get => Q("field_statistics"); set => Q("field_statistics", value); } + + /// + /// Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public bool? Offsets { get => Q("offsets"); set => Q("offsets", value); } + + /// + /// Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public bool? Payloads { get => Q("payloads"); set => Q("payloads", value); } + + /// + /// Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public bool? Positions { get => Q("positions"); set => Q("positions", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specifies if requests are real-time as opposed to near-real-time (default: true). + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + /// + [JsonIgnore] + public bool? TermStatistics { get => Q("term_statistics"); set => Q("term_statistics", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + [JsonInclude, JsonPropertyName("docs")] + public ICollection? Docs { get; set; } + [JsonInclude, JsonPropertyName("ids")] + public ICollection? Ids { get; set; } +} + +/// +/// Returns multiple termvectors in one request. +/// +public sealed partial class MultiTermVectorsRequestDescriptor : RequestDescriptor, MultiTermVectorsRequestParameters> +{ + internal MultiTermVectorsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public MultiTermVectorsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMtermvectors; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mtermvectors"; + + public MultiTermVectorsRequestDescriptor FieldStatistics(bool? fieldStatistics = true) => Qs("field_statistics", fieldStatistics); + public MultiTermVectorsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public MultiTermVectorsRequestDescriptor Offsets(bool? offsets = true) => Qs("offsets", offsets); + public MultiTermVectorsRequestDescriptor Payloads(bool? payloads = true) => Qs("payloads", payloads); + public MultiTermVectorsRequestDescriptor Positions(bool? positions = true) => Qs("positions", positions); + public MultiTermVectorsRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public MultiTermVectorsRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public MultiTermVectorsRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiTermVectorsRequestDescriptor TermStatistics(bool? termStatistics = true) => Qs("term_statistics", termStatistics); + public MultiTermVectorsRequestDescriptor Version(long? version) => Qs("version", version); + public MultiTermVectorsRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private ICollection? DocsValue { get; set; } + private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action> DocsDescriptorAction { get; set; } + private Action>[] DocsDescriptorActions { get; set; } + private ICollection? IdsValue { get; set; } + + public MultiTermVectorsRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(Action> configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(params Action>[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + public MultiTermVectorsRequestDescriptor Ids(ICollection? ids) + { + IdsValue = ids; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + if (IdsValue is not null) + { + writer.WritePropertyName("ids"); + JsonSerializer.Serialize(writer, IdsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Returns multiple termvectors in one request. +/// +public sealed partial class MultiTermVectorsRequestDescriptor : RequestDescriptor +{ + internal MultiTermVectorsRequestDescriptor(Action configure) => configure.Invoke(this); + + public MultiTermVectorsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMtermvectors; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "mtermvectors"; + + public MultiTermVectorsRequestDescriptor FieldStatistics(bool? fieldStatistics = true) => Qs("field_statistics", fieldStatistics); + public MultiTermVectorsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public MultiTermVectorsRequestDescriptor Offsets(bool? offsets = true) => Qs("offsets", offsets); + public MultiTermVectorsRequestDescriptor Payloads(bool? payloads = true) => Qs("payloads", payloads); + public MultiTermVectorsRequestDescriptor Positions(bool? positions = true) => Qs("positions", positions); + public MultiTermVectorsRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public MultiTermVectorsRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public MultiTermVectorsRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public MultiTermVectorsRequestDescriptor TermStatistics(bool? termStatistics = true) => Qs("term_statistics", termStatistics); + public MultiTermVectorsRequestDescriptor Version(long? version) => Qs("version", version); + public MultiTermVectorsRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private ICollection? DocsValue { get; set; } + private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + private ICollection? IdsValue { get; set; } + + public MultiTermVectorsRequestDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public MultiTermVectorsRequestDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + public MultiTermVectorsRequestDescriptor Ids(ICollection? ids) + { + IdsValue = ids; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + if (IdsValue is not null) + { + writer.WritePropertyName("ids"); + JsonSerializer.Serialize(writer, IdsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs new file mode 100644 index 00000000000..b9a5a33512b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class MultiTermVectorsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("docs")] + public IReadOnlyCollection Docs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs new file mode 100644 index 00000000000..1d82b6d503c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class OpenPointInTimeRequestParameters : RequestParameters +{ + /// + /// Specific the time to live for the point in time + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specific routing value + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } +} + +/// +/// A search request by default executes against the most recent visible data of the target indices,
which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the
state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple
search requests using the same point in time. For example, if refreshes happen between
`search_after` requests, then the results of those requests might not be consistent as changes happening
between searches are only visible to the more recent point in time.
+///
+public sealed partial class OpenPointInTimeRequest : PlainRequest +{ + public OpenPointInTimeRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "open_point_in_time"; + + /// + /// Specific the time to live for the point in time + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specific routing value + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } +} + +/// +/// A search request by default executes against the most recent visible data of the target indices,
which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the
state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple
search requests using the same point in time. For example, if refreshes happen between
`search_after` requests, then the results of those requests might not be consistent as changes happening
between searches are only visible to the more recent point in time.
+///
+public sealed partial class OpenPointInTimeRequestDescriptor : RequestDescriptor, OpenPointInTimeRequestParameters> +{ + internal OpenPointInTimeRequestDescriptor(Action> configure) => configure.Invoke(this); + + public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal OpenPointInTimeRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "open_point_in_time"; + + public OpenPointInTimeRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public OpenPointInTimeRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public OpenPointInTimeRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration keepAlive) => Qs("keep_alive", keepAlive); + public OpenPointInTimeRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public OpenPointInTimeRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + + public OpenPointInTimeRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// A search request by default executes against the most recent visible data of the target indices,
which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the
state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple
search requests using the same point in time. For example, if refreshes happen between
`search_after` requests, then the results of those requests might not be consistent as changes happening
between searches are only visible to the more recent point in time.
+///
+public sealed partial class OpenPointInTimeRequestDescriptor : RequestDescriptor +{ + internal OpenPointInTimeRequestDescriptor(Action configure) => configure.Invoke(this); + + public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal OpenPointInTimeRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "open_point_in_time"; + + public OpenPointInTimeRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public OpenPointInTimeRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public OpenPointInTimeRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration keepAlive) => Qs("keep_alive", keepAlive); + public OpenPointInTimeRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public OpenPointInTimeRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + + public OpenPointInTimeRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs new file mode 100644 index 00000000000..20935f77048 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class OpenPointInTimeResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingRequest.g.cs new file mode 100644 index 00000000000..dbf645e08c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class PingRequestParameters : RequestParameters +{ +} + +/// +/// Returns whether the cluster is running. +/// +public sealed partial class PingRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespacePing; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ping"; +} + +/// +/// Returns whether the cluster is running. +/// +public sealed partial class PingRequestDescriptor : RequestDescriptor +{ + internal PingRequestDescriptor(Action configure) => configure.Invoke(this); + + public PingRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespacePing; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ping"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs new file mode 100644 index 00000000000..8d21c41bd23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs @@ -0,0 +1,30 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class PingResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs new file mode 100644 index 00000000000..afab5110afb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs @@ -0,0 +1,265 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class PutScriptRequestParameters : RequestParameters +{ + /// + /// Specify timeout for connection to master + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Creates or updates a script. +/// +public sealed partial class PutScriptRequest : PlainRequest +{ + public PutScriptRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + public PutScriptRequest(Elastic.Clients.Elasticsearch.Serverless.Id id, Elastic.Clients.Elasticsearch.Serverless.Name? context) : base(r => r.Required("id", id).Optional("context", context)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespacePutScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "put_script"; + + /// + /// Specify timeout for connection to master + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.StoredScript Script { get; set; } +} + +/// +/// Creates or updates a script. +/// +public sealed partial class PutScriptRequestDescriptor : RequestDescriptor, PutScriptRequestParameters> +{ + internal PutScriptRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id, Elastic.Clients.Elasticsearch.Serverless.Name? context) : base(r => r.Required("id", id).Optional("context", context)) + { + } + + internal PutScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespacePutScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "put_script"; + + public PutScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) + { + RouteValues.Optional("context", context); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.StoredScript ScriptValue { get; set; } + private StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } + + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.StoredScript script) + { + ScriptDescriptor = null; + ScriptDescriptorAction = null; + ScriptValue = script; + return Self; + } + + public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + { + ScriptValue = null; + ScriptDescriptorAction = null; + ScriptDescriptor = descriptor; + return Self; + } + + public PutScriptRequestDescriptor Script(Action configure) + { + ScriptValue = null; + ScriptDescriptor = null; + ScriptDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ScriptDescriptor is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptDescriptor, options); + } + else if (ScriptDescriptorAction is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + } + else + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates a script. +/// +public sealed partial class PutScriptRequestDescriptor : RequestDescriptor +{ + internal PutScriptRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id, Elastic.Clients.Elasticsearch.Serverless.Name? context) : base(r => r.Required("id", id).Optional("context", context)) + { + } + + internal PutScriptRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespacePutScript; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "put_script"; + + public PutScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) + { + RouteValues.Optional("context", context); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.StoredScript ScriptValue { get; set; } + private StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } + + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.StoredScript script) + { + ScriptDescriptor = null; + ScriptDescriptorAction = null; + ScriptValue = script; + return Self; + } + + public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + { + ScriptValue = null; + ScriptDescriptorAction = null; + ScriptDescriptor = descriptor; + return Self; + } + + public PutScriptRequestDescriptor Script(Action configure) + { + ScriptValue = null; + ScriptDescriptor = null; + ScriptDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ScriptDescriptor is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptDescriptor, options); + } + else if (ScriptDescriptorAction is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + } + else + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs new file mode 100644 index 00000000000..4b6ecb4b85c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class PutScriptResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs new file mode 100644 index 00000000000..4a3d6280a1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs @@ -0,0 +1,427 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class RankEvalRequestParameters : RequestParameters +{ + /// + /// 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`. + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, missing or closed indices are not included in the response. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Search operation type + /// + public string? SearchType { get => Q("search_type"); set => Q("search_type", value); } +} + +/// +/// Enables you to evaluate the quality of ranked search results over a set of typical search queries. +/// +public sealed partial class RankEvalRequest : PlainRequest +{ + public RankEvalRequest() + { + } + + public RankEvalRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRankEval; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rank_eval"; + + /// + /// 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`. + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, missing or closed indices are not included in the response. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Search operation type + /// + [JsonIgnore] + public string? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// A set of typical search requests, together with their provided ratings. + /// + [JsonInclude, JsonPropertyName("requests")] + public ICollection Requests { get; set; } + + /// + /// Definition of the evaluation metric to calculate. + /// + [JsonInclude, JsonPropertyName("metric")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? Metric { get; set; } +} + +/// +/// Enables you to evaluate the quality of ranked search results over a set of typical search queries. +/// +public sealed partial class RankEvalRequestDescriptor : RequestDescriptor, RankEvalRequestParameters> +{ + internal RankEvalRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RankEvalRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRankEval; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rank_eval"; + + public RankEvalRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public RankEvalRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public RankEvalRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public RankEvalRequestDescriptor SearchType(string? searchType) => Qs("search_type", searchType); + + public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private ICollection RequestsValue { get; set; } + private Core.RankEval.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action> RequestsDescriptorAction { get; set; } + private Action>[] RequestsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? MetricValue { get; set; } + private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } + + /// + /// A set of typical search requests, together with their provided ratings. + /// + public RankEvalRequestDescriptor Requests(ICollection requests) + { + RequestsDescriptor = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = null; + RequestsValue = requests; + return Self; + } + + public RankEvalRequestDescriptor Requests(Core.RankEval.RankEvalRequestItemDescriptor descriptor) + { + RequestsValue = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = null; + RequestsDescriptor = descriptor; + return Self; + } + + public RankEvalRequestDescriptor Requests(Action> configure) + { + RequestsValue = null; + RequestsDescriptor = null; + RequestsDescriptorActions = null; + RequestsDescriptorAction = configure; + return Self; + } + + public RankEvalRequestDescriptor Requests(params Action>[] configure) + { + RequestsValue = null; + RequestsDescriptor = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = configure; + return Self; + } + + /// + /// Definition of the evaluation metric to calculate. + /// + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? metric) + { + MetricDescriptor = null; + MetricDescriptorAction = null; + MetricValue = metric; + return Self; + } + + public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + { + MetricValue = null; + MetricDescriptorAction = null; + MetricDescriptor = descriptor; + return Self; + } + + public RankEvalRequestDescriptor Metric(Action configure) + { + MetricValue = null; + MetricDescriptor = null; + MetricDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestsDescriptor is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RequestsDescriptor, options); + writer.WriteEndArray(); + } + else if (RequestsDescriptorAction is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RequestsDescriptorActions is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + foreach (var action in RequestsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("requests"); + JsonSerializer.Serialize(writer, RequestsValue, options); + } + + if (MetricDescriptor is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, MetricDescriptor, options); + } + else if (MetricDescriptorAction is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + } + else if (MetricValue is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, MetricValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Enables you to evaluate the quality of ranked search results over a set of typical search queries. +/// +public sealed partial class RankEvalRequestDescriptor : RequestDescriptor +{ + internal RankEvalRequestDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRankEval; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rank_eval"; + + public RankEvalRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public RankEvalRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public RankEvalRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public RankEvalRequestDescriptor SearchType(string? searchType) => Qs("search_type", searchType); + + public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private ICollection RequestsValue { get; set; } + private Core.RankEval.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action RequestsDescriptorAction { get; set; } + private Action[] RequestsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? MetricValue { get; set; } + private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } + + /// + /// A set of typical search requests, together with their provided ratings. + /// + public RankEvalRequestDescriptor Requests(ICollection requests) + { + RequestsDescriptor = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = null; + RequestsValue = requests; + return Self; + } + + public RankEvalRequestDescriptor Requests(Core.RankEval.RankEvalRequestItemDescriptor descriptor) + { + RequestsValue = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = null; + RequestsDescriptor = descriptor; + return Self; + } + + public RankEvalRequestDescriptor Requests(Action configure) + { + RequestsValue = null; + RequestsDescriptor = null; + RequestsDescriptorActions = null; + RequestsDescriptorAction = configure; + return Self; + } + + public RankEvalRequestDescriptor Requests(params Action[] configure) + { + RequestsValue = null; + RequestsDescriptor = null; + RequestsDescriptorAction = null; + RequestsDescriptorActions = configure; + return Self; + } + + /// + /// Definition of the evaluation metric to calculate. + /// + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? metric) + { + MetricDescriptor = null; + MetricDescriptorAction = null; + MetricValue = metric; + return Self; + } + + public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + { + MetricValue = null; + MetricDescriptorAction = null; + MetricDescriptor = descriptor; + return Self; + } + + public RankEvalRequestDescriptor Metric(Action configure) + { + MetricValue = null; + MetricDescriptor = null; + MetricDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestsDescriptor is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RequestsDescriptor, options); + writer.WriteEndArray(); + } + else if (RequestsDescriptorAction is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RequestsDescriptorActions is not null) + { + writer.WritePropertyName("requests"); + writer.WriteStartArray(); + foreach (var action in RequestsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("requests"); + JsonSerializer.Serialize(writer, RequestsValue, options); + } + + if (MetricDescriptor is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, MetricDescriptor, options); + } + else if (MetricDescriptorAction is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + } + else if (MetricValue is not null) + { + writer.WritePropertyName("metric"); + JsonSerializer.Serialize(writer, MetricValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs new file mode 100644 index 00000000000..57577b65517 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RankEvalResponse : ElasticsearchResponse +{ + /// + /// The details section contains one entry for every query in the original requests section, keyed by the search request id + /// + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyDictionary Details { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyDictionary Failures { get; init; } + + /// + /// The overall evaluation quality calculated by the defined metric + /// + [JsonInclude, JsonPropertyName("metric_score")] + public double MetricScore { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs new file mode 100644 index 00000000000..811037eab3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class RenderSearchTemplateRequestParameters : RequestParameters +{ +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class RenderSearchTemplateRequest : PlainRequest +{ + public RenderSearchTemplateRequest() + { + } + + public RenderSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRenderSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "render_search_template"; + + [JsonInclude, JsonPropertyName("file")] + public string? File { get; set; } + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class RenderSearchTemplateRequestDescriptor : RequestDescriptor, RenderSearchTemplateRequestParameters> +{ + internal RenderSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RenderSearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRenderSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "render_search_template"; + + public RenderSearchTemplateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private string? FileValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + + public RenderSearchTemplateRequestDescriptor File(string? file) + { + FileValue = file; + return Self; + } + + public RenderSearchTemplateRequestDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RenderSearchTemplateRequestDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FileValue)) + { + writer.WritePropertyName("file"); + writer.WriteStringValue(FileValue); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class RenderSearchTemplateRequestDescriptor : RequestDescriptor +{ + internal RenderSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public RenderSearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceRenderSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "render_search_template"; + + public RenderSearchTemplateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private string? FileValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + + public RenderSearchTemplateRequestDescriptor File(string? file) + { + FileValue = file; + return Self; + } + + public RenderSearchTemplateRequestDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RenderSearchTemplateRequestDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FileValue)) + { + writer.WritePropertyName("file"); + writer.WriteStringValue(FileValue); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs new file mode 100644 index 00000000000..5a0a5c3f420 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RenderSearchTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("template_output")] + public IReadOnlyDictionary TemplateOutput { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollRequest.g.cs new file mode 100644 index 00000000000..59766891374 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollRequest.g.cs @@ -0,0 +1,127 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class ScrollRequestParameters : RequestParameters +{ + /// + /// If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. + /// + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } +} + +/// +/// Allows to retrieve a large numbers of results from a single search request. +/// +public sealed partial class ScrollRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceScroll; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "scroll"; + + /// + /// If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. + /// + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Period to retain the search context for scrolling. + /// + [JsonInclude, JsonPropertyName("scroll")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get; set; } + + /// + /// Scroll ID of the search. + /// + [JsonInclude, JsonPropertyName("scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId ScrollId { get; set; } +} + +/// +/// Allows to retrieve a large numbers of results from a single search request. +/// +public sealed partial class ScrollRequestDescriptor : RequestDescriptor +{ + internal ScrollRequestDescriptor(Action configure) => configure.Invoke(this); + + public ScrollRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceScroll; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "scroll"; + + public ScrollRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + + private Elastic.Clients.Elasticsearch.Serverless.Duration? ScrollValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ScrollId ScrollIdValue { get; set; } + + /// + /// Period to retain the search context for scrolling. + /// + public ScrollRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) + { + ScrollValue = scroll; + return Self; + } + + /// + /// Scroll ID of the search. + /// + public ScrollRequestDescriptor ScrollId(Elastic.Clients.Elasticsearch.Serverless.ScrollId scrollId) + { + ScrollIdValue = scrollId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ScrollValue is not null) + { + writer.WritePropertyName("scroll"); + JsonSerializer.Serialize(writer, ScrollValue, options); + } + + writer.WritePropertyName("scroll_id"); + JsonSerializer.Serialize(writer, ScrollIdValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs new file mode 100644 index 00000000000..2f8ead2c596 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ScrollResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata HitsMetadata { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + [JsonInclude, JsonPropertyName("num_reduce_phases")] + public long? NumReducePhases { get; init; } + [JsonInclude, JsonPropertyName("pit_id")] + public string? PitId { get; init; } + [JsonInclude, JsonPropertyName("profile")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } + [JsonInclude, JsonPropertyName("terminated_early")] + public bool? TerminatedEarly { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs new file mode 100644 index 00000000000..d5f1eaf6eaf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs @@ -0,0 +1,3301 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class SearchRequestParameters : RequestParameters +{ + /// + /// 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`.
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. + /// + public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); } + + /// + /// Analyzer to use for the query string.
This parameter can only be used when the q query string parameter is specified.
+ ///
+ public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// If true, wildcard and prefix queries are analyzed.
This parameter can only be used when the q query string parameter is specified.
+ ///
+ public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The number of shard results that should be reduced at once on the coordinating node.
This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
+ ///
+ public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); } + + /// + /// If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. + /// + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// The default operator for query string query: AND or OR.
This parameter can only be used when the `q` query string parameter is specified.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// 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.
+ ///
+ public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// 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`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, concrete, expanded or aliased indices will be ignored when frozen. + /// + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
This parameter can only be used when the `q` query string parameter is specified.
+ ///
+ public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Defines the number of concurrent shard requests per node this search executes concurrently.
This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
+ ///
+ public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + + /// + /// The minimum version of the node that can handle the request
Any handling node with a lower version will fail the request.
+ ///
+ public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); } + + /// + /// Nodes and shards used for the search.
By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:
`_only_local` to run the search only on shards on the local node;
`_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
`_only_nodes:,` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method;
`_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method;
`_shards:,` to run the search only on the specified shards;
`` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.
+ ///
+ public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.
This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).
When unspecified, the pre-filter phase is executed if any of these conditions is met:
the request targets more than 128 shards;
the request targets one or more read-only index;
the primary sort of the query targets an indexed field.
+ ///
+ public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// If `true`, the caching of search results is enabled for requests where `size` is `0`.
Defaults to index level settings.
+ ///
+ public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Period to retain the search context for scrolling. See Scroll search results.
By default, this value cannot exceed `1d` (24 hours).
You can change this limit using the `search.max_keep_alive` cluster-level setting.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// How distributed term frequencies are calculated for relevance scoring. + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies which field to use for suggestions. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); } + + /// + /// Specifies the suggest mode.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); } + + /// + /// Number of suggestions to return.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); } + + /// + /// The source text for which the suggestions should be returned.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); } + + /// + /// If `true`, aggregation and suggester names are be prefixed by their respective types in the response. + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + + /// + /// Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. + /// + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// A comma-separated list of source fields to exclude from the response.
You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response.
If this parameter is specified, only these source fields are returned.
You can exclude fields from this subset using the `_source_excludes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Query in the Lucene query string syntax using query parameter search.
Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.
+ ///
+ public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } +} + +internal sealed partial class SearchRequestConverter : JsonConverter +{ + public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new SearchRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations" || property == "aggs") + { + variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "collapse") + { + variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "explain") + { + variant.Explain = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ext") + { + variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "highlight") + { + variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_total_hits") + { + variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_boost") + { + variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + continue; + } + + if (property == "docvalue_fields") + { + variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "knn") + { + variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "rank") + { + variant.Rank = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "min_score") + { + variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "post_filter") + { + variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "profile") + { + variant.Profile = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rescore") + { + variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "search_after") + { + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "size") + { + variant.Size = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "slice") + { + variant.Slice = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "sort") + { + variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "_source") + { + variant.Source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fields") + { + variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "suggest") + { + variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "terminate_after") + { + variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "timeout") + { + variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_scores") + { + variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "seq_no_primary_term") + { + variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "stored_fields") + { + variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pit") + { + variant.Pit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stats") + { + variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.Collapse is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, value.Collapse, options); + } + + if (value.Explain.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(value.Explain.Value); + } + + if (value.Ext is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, value.Ext, options); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.TrackTotalHits is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, value.TrackTotalHits, options); + } + + if (value.IndicesBoost is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, value.IndicesBoost, options); + } + + if (value.DocvalueFields is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, value.DocvalueFields, options); + } + + if (value.Knn is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, value.Knn, options); + } + + if (value.Rank is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, value.Rank, options); + } + + if (value.MinScore.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(value.MinScore.Value); + } + + if (value.PostFilter is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, value.PostFilter, options); + } + + if (value.Profile.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(value.Profile.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.Rescore is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, value.Rescore, options); + } + + if (value.ScriptFields is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, value.ScriptFields, options); + } + + if (value.SearchAfter is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, value.SearchAfter, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Slice is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, value.Slice, options); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + } + + if (value.Source is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, value.Source, options); + } + + if (value.Fields is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, value.Fields, options); + } + + if (value.Suggest is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, value.Suggest, options); + } + + if (value.TerminateAfter.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(value.TerminateAfter.Value); + } + + if (!string.IsNullOrEmpty(value.Timeout)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(value.Timeout); + } + + if (value.TrackScores.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(value.TrackScores.Value); + } + + if (value.Version.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(value.Version.Value); + } + + if (value.SeqNoPrimaryTerm.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value); + } + + if (value.StoredFields is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, value.StoredFields, options); + } + + if (value.Pit is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, value.Pit, options); + } + + if (value.RuntimeMappings is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, value.RuntimeMappings, options); + } + + if (value.Stats is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, value.Stats, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SearchRequestConverter))] +/// +/// Returns search hits that match the query defined in the request.
You can provide search queries using the `q` query string parameter or the request body.
If both are specified, only the query parameter is used.
+///
+public partial class SearchRequest : PlainRequest +{ + public SearchRequest() + { + } + + public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search"; + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. + /// + [JsonIgnore] + public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); } + + /// + /// Analyzer to use for the query string.
This parameter can only be used when the q query string parameter is specified.
+ ///
+ [JsonIgnore] + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// If true, wildcard and prefix queries are analyzed.
This parameter can only be used when the q query string parameter is specified.
+ ///
+ [JsonIgnore] + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The number of shard results that should be reduced at once on the coordinating node.
This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
+ ///
+ [JsonIgnore] + public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); } + + /// + /// If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. + /// + [JsonIgnore] + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// The default operator for query string query: AND or OR.
This parameter can only be used when the `q` query string parameter is specified.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// 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.
+ ///
+ [JsonIgnore] + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// 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`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, concrete, expanded or aliased indices will be ignored when frozen. + /// + [JsonIgnore] + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// If `false`, the request returns an error if it targets a missing or closed index. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
This parameter can only be used when the `q` query string parameter is specified.
+ ///
+ [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Defines the number of concurrent shard requests per node this search executes concurrently.
This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
+ ///
+ [JsonIgnore] + public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); } + + /// + /// The minimum version of the node that can handle the request
Any handling node with a lower version will fail the request.
+ ///
+ [JsonIgnore] + public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); } + + /// + /// Nodes and shards used for the search.
By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:
`_only_local` to run the search only on shards on the local node;
`_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
`_only_nodes:,` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method;
`_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method;
`_shards:,` to run the search only on the specified shards;
`` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.
+ ///
+ [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.
This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).
When unspecified, the pre-filter phase is executed if any of these conditions is met:
the request targets more than 128 shards;
the request targets one or more read-only index;
the primary sort of the query targets an indexed field.
+ ///
+ [JsonIgnore] + public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); } + + /// + /// If `true`, the caching of search results is enabled for requests where `size` is `0`.
Defaults to index level settings.
+ ///
+ [JsonIgnore] + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Period to retain the search context for scrolling. See Scroll search results.
By default, this value cannot exceed `1d` (24 hours).
You can change this limit using the `search.max_keep_alive` cluster-level setting.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// How distributed term frequencies are calculated for relevance scoring. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// Specifies which field to use for suggestions. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); } + + /// + /// Specifies the suggest mode.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); } + + /// + /// Number of suggestions to return.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ [JsonIgnore] + public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); } + + /// + /// The source text for which the suggestions should be returned.
This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ ///
+ [JsonIgnore] + public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); } + + /// + /// If `true`, aggregation and suggester names are be prefixed by their respective types in the response. + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + + /// + /// Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. + /// + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// A comma-separated list of source fields to exclude from the response.
You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// A comma-separated list of source fields to include in the response.
If this parameter is specified, only these source fields are returned.
You can exclude fields from this subset using the `_source_excludes` query parameter.
If the `_source` parameter is `false`, this parameter is ignored.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Query in the Lucene query string syntax using query parameter search.
Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.
+ ///
+ [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// Defines the aggregations that are run as part of the search request. + /// + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Collapses search results the values of the specified field. + /// + [JsonInclude, JsonPropertyName("collapse")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + [JsonInclude, JsonPropertyName("ext")] + public IDictionary? Ext { get; set; } + + /// + /// Starting document offset.
Needs to be non-negative.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ [JsonInclude, JsonPropertyName("from")] + public int? From { get; set; } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results. + /// + [JsonInclude, JsonPropertyName("highlight")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; } + + /// + /// Number of hits matching the query to count accurately.
If `true`, the exact number of hits is returned at the cost of some performance.
If `false`, the response does not include the total number of hits matching the query.
+ ///
+ [JsonInclude, JsonPropertyName("track_total_hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; set; } + + /// + /// Boosts the _score of documents from specified indices. + /// + [JsonInclude, JsonPropertyName("indices_boost")] + public ICollection>? IndicesBoost { get; set; } + + /// + /// Array of wildcard (`*`) patterns.
The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("docvalue_fields")] + public ICollection? DocvalueFields { get; set; } + + /// + /// Defines the approximate kNN search to run. + /// + [JsonInclude, JsonPropertyName("knn"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnQuery))] + public ICollection? Knn { get; set; } + + /// + /// Defines the Reciprocal Rank Fusion (RRF) to use. + /// + [JsonInclude, JsonPropertyName("rank")] + public Elastic.Clients.Elasticsearch.Serverless.Rank? Rank { get; set; } + + /// + /// Minimum `_score` for matching documents.
Documents with a lower `_score` are not included in the search results.
+ ///
+ [JsonInclude, JsonPropertyName("min_score")] + public double? MinScore { get; set; } + + /// + /// Use the `post_filter` parameter to filter search results.
The search hits are filtered after the aggregations are calculated.
A post filter has no impact on the aggregation results.
+ ///
+ [JsonInclude, JsonPropertyName("post_filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; set; } + + /// + /// Set to `true` to return detailed timing information about the execution of individual components in a search request.
NOTE: This is a debugging tool and adds significant overhead to search execution.
+ ///
+ [JsonInclude, JsonPropertyName("profile")] + public bool? Profile { get; set; } + + /// + /// Defines the search definition using the Query DSL. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. + /// + [JsonInclude, JsonPropertyName("rescore"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore))] + public ICollection? Rescore { get; set; } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + + /// + /// Used to retrieve the next page of hits using a set of sort values from the previous page. + /// + [JsonInclude, JsonPropertyName("search_after")] + public ICollection? SearchAfter { get; set; } + + /// + /// The number of hits to return.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// Can be used to split a scrolled search into multiple slices that can be consumed independently. + /// + [JsonInclude, JsonPropertyName("slice")] + public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; } + + /// + /// A comma-separated list of : pairs. + /// + [JsonInclude, JsonPropertyName("sort"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] + public ICollection? Sort { get; set; } + + /// + /// Indicates which source fields are returned for matching documents.
These fields are returned in the hits._source property of the search response.
+ ///
+ [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + + /// + /// Array of wildcard (`*`) patterns.
The request returns values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + + /// + /// Defines a suggester that provides similar looking terms based on a provided text. + /// + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; } + + /// + /// Maximum number of documents to collect for each shard.
If a query reaches this limit, Elasticsearch terminates the query early.
Elasticsearch collects documents before sorting.
Use with caution.
Elasticsearch applies this parameter to each shard handling the request.
When possible, let Elasticsearch perform early termination automatically.
Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
If set to `0` (default), the query does not terminate early.
+ ///
+ [JsonInclude, JsonPropertyName("terminate_after")] + public long? TerminateAfter { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("timeout")] + public string? Timeout { get; set; } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + [JsonInclude, JsonPropertyName("track_scores")] + public bool? TrackScores { get; set; } + + /// + /// If true, returns document version as part of a hit. + /// + [JsonInclude, JsonPropertyName("version")] + public bool? Version { get; set; } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + [JsonInclude, JsonPropertyName("seq_no_primary_term")] + public bool? SeqNoPrimaryTerm { get; set; } + + /// + /// List of stored fields to return as part of a hit.
If no fields are specified, no stored fields are included in the response.
If this field is specified, the `_source` parameter defaults to `false`.
You can pass `_source: true` to return both source fields and stored fields in the search response.
+ ///
+ [JsonInclude, JsonPropertyName("stored_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } + + /// + /// Limits the search to a point in time (PIT).
If you provide a PIT, you cannot specify an `` in the request path.
+ ///
+ [JsonInclude, JsonPropertyName("pit")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; set; } + + /// + /// Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Stats groups to associate with the search.
Each group maintains a statistics aggregation for its associated searches.
You can retrieve these stats using the indices stats API.
+ ///
+ [JsonInclude, JsonPropertyName("stats")] + public ICollection? Stats { get; set; } +} + +/// +/// Returns search hits that match the query defined in the request.
You can provide search queries using the `q` query string parameter or the request body.
If both are specified, only the query parameter is used.
+///
+public partial class SearchRequest : SearchRequest +{ + public SearchRequest() : base(typeof(TInferDocument)) + { + } +} + +/// +/// Returns search hits that match the query defined in the request.
You can provide search queries using the `q` query string parameter or the request body.
If both are specified, only the query parameter is used.
+///
+public sealed partial class SearchRequestDescriptor : RequestDescriptor, SearchRequestParameters> +{ + internal SearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SearchRequestDescriptor() : this(typeof(TDocument)) + { + } + + public SearchRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search"; + + public SearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public SearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public SearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SearchRequestDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) => Qs("allow_partial_search_results", allowPartialSearchResults); + public SearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public SearchRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public SearchRequestDescriptor BatchedReduceSize(long? batchedReduceSize) => Qs("batched_reduce_size", batchedReduceSize); + public SearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SearchRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public SearchRequestDescriptor Df(string? df) => Qs("df", df); + public SearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SearchRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public SearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public SearchRequestDescriptor MinCompatibleShardNode(string? minCompatibleShardNode) => Qs("min_compatible_shard_node", minCompatibleShardNode); + public SearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public SearchRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SearchRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public SearchRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public SearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SearchRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Serverless.Field? suggestField) => Qs("suggest_field", suggestField); + public SearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) => Qs("suggest_mode", suggestMode); + public SearchRequestDescriptor SuggestSize(long? suggestSize) => Qs("suggest_size", suggestSize); + public SearchRequestDescriptor SuggestText(string? suggestText) => Qs("suggest_text", suggestText); + public SearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Rank? RankValue { get; set; } + private RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + /// + /// Defines the aggregations that are run as part of the search request. + /// + public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Collapses search results the values of the specified field. + /// + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Collapse(Action> configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) patterns.
The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ public SearchRequestDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) patterns.
The request returns values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ public SearchRequestDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public SearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results. + /// + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Highlight(Action> configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public SearchRequestDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public SearchRequestDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Knn(Action> configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Knn(params Action>[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + /// + /// Use the `post_filter` parameter to filter search results.
The search hits are filtered after the aggregations are calculated.
A post filter has no impact on the aggregation results.
+ ///
+ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor PostFilter(Action> configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. + /// + public SearchRequestDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public SearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Rescore(Action> configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Rescore(params Action>[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + /// + /// Can be used to split a scrolled search into multiple slices that can be consumed independently. + /// + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Slice(Action> configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + /// + /// A comma-separated list of : pairs. + /// + public SearchRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchRequestDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents.
These fields are returned in the hits._source property of the search response.
+ ///
+ public SearchRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public SearchRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public SearchRequestDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset.
Needs to be non-negative.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ public SearchRequestDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public SearchRequestDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum `_score` for matching documents.
Documents with a lower `_score` are not included in the search results.
+ ///
+ public SearchRequestDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT).
If you provide a PIT, you cannot specify an `` in the request path.
+ ///
+ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + /// + /// Set to `true` to return detailed timing information about the execution of individual components in a search request.
NOTE: This is a debugging tool and adds significant overhead to search execution.
+ ///
+ public SearchRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines the Reciprocal Rank Fusion (RRF) to use. + /// + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Serverless.Rank? rank) + { + RankDescriptor = null; + RankDescriptorAction = null; + RankValue = rank; + return Self; + } + + public SearchRequestDescriptor Rank(RankDescriptor descriptor) + { + RankValue = null; + RankDescriptorAction = null; + RankDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Rank(Action configure) + { + RankValue = null; + RankDescriptor = null; + RankDescriptorAction = configure; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
+ ///
+ public SearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Used to retrieve the next page of hits using a set of sort values from the previous page. + /// + public SearchRequestDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + public SearchRequestDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ public SearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search.
Each group maintains a statistics aggregation for its associated searches.
You can retrieve these stats using the indices stats API.
+ ///
+ public SearchRequestDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit.
If no fields are specified, no stored fields are included in the response.
If this field is specified, the `_source` parameter defaults to `false`.
You can pass `_source: true` to return both source fields and stored fields in the search response.
+ ///
+ public SearchRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + /// + /// Defines a suggester that provides similar looking terms based on a provided text. + /// + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard.
If a query reaches this limit, Elasticsearch terminates the query early.
Elasticsearch collects documents before sorting.
Use with caution.
Elasticsearch applies this parameter to each shard handling the request.
When possible, let Elasticsearch perform early termination automatically.
Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
If set to `0` (default), the query does not terminate early.
+ ///
+ public SearchRequestDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public SearchRequestDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public SearchRequestDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately.
If `true`, the exact number of hits is returned at the cost of some performance.
If `false`, the response does not include the total number of hits matching the query.
+ ///
+ public SearchRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public SearchRequestDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RankDescriptor is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, RankDescriptor, options); + } + else if (RankDescriptorAction is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + } + else if (RankValue is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, RankValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Returns search hits that match the query defined in the request.
You can provide search queries using the `q` query string parameter or the request body.
If both are specified, only the query parameter is used.
+///
+public sealed partial class SearchRequestDescriptor : RequestDescriptor +{ + internal SearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SearchRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search"; + + public SearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public SearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public SearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SearchRequestDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) => Qs("allow_partial_search_results", allowPartialSearchResults); + public SearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public SearchRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public SearchRequestDescriptor BatchedReduceSize(long? batchedReduceSize) => Qs("batched_reduce_size", batchedReduceSize); + public SearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SearchRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public SearchRequestDescriptor Df(string? df) => Qs("df", df); + public SearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SearchRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public SearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests); + public SearchRequestDescriptor MinCompatibleShardNode(string? minCompatibleShardNode) => Qs("min_compatible_shard_node", minCompatibleShardNode); + public SearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize); + public SearchRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SearchRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q); + public SearchRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public SearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SearchRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Serverless.Field? suggestField) => Qs("suggest_field", suggestField); + public SearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) => Qs("suggest_mode", suggestMode); + public SearchRequestDescriptor SuggestSize(long? suggestSize) => Qs("suggest_size", suggestSize); + public SearchRequestDescriptor SuggestText(string? suggestText) => Qs("suggest_text", suggestText); + public SearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Rank? RankValue { get; set; } + private RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + /// + /// Defines the aggregations that are run as part of the search request. + /// + public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Collapses search results the values of the specified field. + /// + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Collapse(Action configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) patterns.
The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ public SearchRequestDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (`*`) patterns.
The request returns values for field names matching these patterns in the `hits.fields` property of the response.
+ ///
+ public SearchRequestDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public SearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results. + /// + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public SearchRequestDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public SearchRequestDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Knn(Action configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Knn(params Action[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + /// + /// Use the `post_filter` parameter to filter search results.
The search hits are filtered after the aggregations are calculated.
A post filter has no impact on the aggregation results.
+ ///
+ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor PostFilter(Action configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. + /// + public SearchRequestDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public SearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Rescore(Action configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Rescore(params Action[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + /// + /// Can be used to split a scrolled search into multiple slices that can be consumed independently. + /// + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Slice(Action configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + /// + /// A comma-separated list of : pairs. + /// + public SearchRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchRequestDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchRequestDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents.
These fields are returned in the hits._source property of the search response.
+ ///
+ public SearchRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public SearchRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public SearchRequestDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset.
Needs to be non-negative.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ public SearchRequestDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public SearchRequestDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum `_score` for matching documents.
Documents with a lower `_score` are not included in the search results.
+ ///
+ public SearchRequestDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT).
If you provide a PIT, you cannot specify an `` in the request path.
+ ///
+ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + /// + /// Set to `true` to return detailed timing information about the execution of individual components in a search request.
NOTE: This is a debugging tool and adds significant overhead to search execution.
+ ///
+ public SearchRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines the Reciprocal Rank Fusion (RRF) to use. + /// + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Serverless.Rank? rank) + { + RankDescriptor = null; + RankDescriptorAction = null; + RankValue = rank; + return Self; + } + + public SearchRequestDescriptor Rank(RankDescriptor descriptor) + { + RankValue = null; + RankDescriptorAction = null; + RankDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Rank(Action configure) + { + RankValue = null; + RankDescriptor = null; + RankDescriptorAction = configure; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
+ ///
+ public SearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Used to retrieve the next page of hits using a set of sort values from the previous page. + /// + public SearchRequestDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + public SearchRequestDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return.
By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
To page through more hits, use the `search_after` parameter.
+ ///
+ public SearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search.
Each group maintains a statistics aggregation for its associated searches.
You can retrieve these stats using the indices stats API.
+ ///
+ public SearchRequestDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit.
If no fields are specified, no stored fields are included in the response.
If this field is specified, the `_source` parameter defaults to `false`.
You can pass `_source: true` to return both source fields and stored fields in the search response.
+ ///
+ public SearchRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + /// + /// Defines a suggester that provides similar looking terms based on a provided text. + /// + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public SearchRequestDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard.
If a query reaches this limit, Elasticsearch terminates the query early.
Elasticsearch collects documents before sorting.
Use with caution.
Elasticsearch applies this parameter to each shard handling the request.
When possible, let Elasticsearch perform early termination automatically.
Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
If set to `0` (default), the query does not terminate early.
+ ///
+ public SearchRequestDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public SearchRequestDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public SearchRequestDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately.
If `true`, the exact number of hits is returned at the cost of some performance.
If `false`, the response does not include the total number of hits matching the query.
+ ///
+ public SearchRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public SearchRequestDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RankDescriptor is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, RankDescriptor, options); + } + else if (RankDescriptorAction is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + } + else if (RankValue is not null) + { + writer.WritePropertyName("rank"); + JsonSerializer.Serialize(writer, RankValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs new file mode 100644 index 00000000000..7a83ad970b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class SearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata HitsMetadata { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + [JsonInclude, JsonPropertyName("num_reduce_phases")] + public long? NumReducePhases { get; init; } + [JsonInclude, JsonPropertyName("pit_id")] + public string? PitId { get; init; } + [JsonInclude, JsonPropertyName("profile")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } + [JsonInclude, JsonPropertyName("terminated_early")] + public bool? TerminatedEarly { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs new file mode 100644 index 00000000000..03ab4fb0fdb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs @@ -0,0 +1,426 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class SearchTemplateRequestParameters : RequestParameters +{ + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + /// + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies how long a consistent view of the index
should be maintained for scrolled search.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// The type of the search operation. + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// If true, hits.total are rendered as an integer in the response. + /// + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class SearchTemplateRequest : PlainRequest +{ + public SearchTemplateRequest() + { + } + + public SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_template"; + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + /// + [JsonIgnore] + public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled + /// + [JsonIgnore] + public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies how long a consistent view of the index
should be maintained for scrolled search.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// The type of the search operation. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// If true, hits.total are rendered as an integer in the response. + /// + [JsonIgnore] + public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } + + /// + /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response + /// + [JsonIgnore] + public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// ID of the search template to use. If no source is specified,
this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("profile")] + public bool? Profile { get; set; } + + /// + /// An inline search template. Supports the same parameters as the search API's
request body. Also supports Mustache variables. If no id is specified, this
parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class SearchTemplateRequestDescriptor : RequestDescriptor, SearchTemplateRequestParameters> +{ + internal SearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_template"; + + public SearchTemplateRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SearchTemplateRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SearchTemplateRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SearchTemplateRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SearchTemplateRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SearchTemplateRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SearchTemplateRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SearchTemplateRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SearchTemplateRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SearchTemplateRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public SearchTemplateRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private bool? ProfileValue { get; set; } + private string? SourceValue { get; set; } + + public SearchTemplateRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// ID of the search template to use. If no source is specified,
this parameter is required.
+ ///
+ public SearchTemplateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + public SearchTemplateRequestDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SearchTemplateRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// An inline search template. Supports the same parameters as the search API's
request body. Also supports Mustache variables. If no id is specified, this
parameter is required.
+ ///
+ public SearchTemplateRequestDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Allows to use the Mustache language to pre-render a search definition. +/// +public sealed partial class SearchTemplateRequestDescriptor : RequestDescriptor +{ + internal SearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_template"; + + public SearchTemplateRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips); + public SearchTemplateRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SearchTemplateRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public SearchTemplateRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SearchTemplateRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public SearchTemplateRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public SearchTemplateRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public SearchTemplateRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public SearchTemplateRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public SearchTemplateRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public SearchTemplateRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private bool? ProfileValue { get; set; } + private string? SourceValue { get; set; } + + public SearchTemplateRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// ID of the search template to use. If no source is specified,
this parameter is required.
+ ///
+ public SearchTemplateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + public SearchTemplateRequestDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SearchTemplateRequestDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// An inline search template. Supports the same parameters as the search API's
request body. Also supports Mustache variables. If no id is specified, this
parameter is required.
+ ///
+ public SearchTemplateRequestDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs new file mode 100644 index 00000000000..c9ece6b884f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class SearchTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata Hits { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + [JsonInclude, JsonPropertyName("num_reduce_phases")] + public long? NumReducePhases { get; init; } + [JsonInclude, JsonPropertyName("pit_id")] + public string? PitId { get; init; } + [JsonInclude, JsonPropertyName("profile")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } + [JsonInclude, JsonPropertyName("terminated_early")] + public bool? TerminatedEarly { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs new file mode 100644 index 00000000000..b46381a7697 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs @@ -0,0 +1,323 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class TermVectorsRequestParameters : RequestParameters +{ + /// + /// A comma-separated list of fields to return. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + /// + public bool? FieldStatistics { get => Q("field_statistics"); set => Q("field_statistics", value); } + + /// + /// Specifies if term offsets should be returned. + /// + public bool? Offsets { get => Q("offsets"); set => Q("offsets", value); } + + /// + /// Specifies if term payloads should be returned. + /// + public bool? Payloads { get => Q("payloads"); set => Q("payloads", value); } + + /// + /// Specifies if term positions should be returned. + /// + public bool? Positions { get => Q("positions"); set => Q("positions", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random). + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specifies if request is real-time as opposed to near-real-time (default: true). + /// + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Specific routing value. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies if total term frequency and document frequency should be returned. + /// + public bool? TermStatistics { get => Q("term_statistics"); set => Q("term_statistics", value); } + + /// + /// Explicit version number for concurrency control + /// + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } +} + +/// +/// Returns information and statistics about terms in the fields of a particular document. +/// +public sealed partial class TermVectorsRequest : PlainRequest +{ + public TermVectorsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) + { + } + + public TermVectorsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "termvectors"; + + [JsonIgnore] + public TDocument Document { get; set; } + + /// + /// A comma-separated list of fields to return. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + /// + [JsonIgnore] + public bool? FieldStatistics { get => Q("field_statistics"); set => Q("field_statistics", value); } + + /// + /// Specifies if term offsets should be returned. + /// + [JsonIgnore] + public bool? Offsets { get => Q("offsets"); set => Q("offsets", value); } + + /// + /// Specifies if term payloads should be returned. + /// + [JsonIgnore] + public bool? Payloads { get => Q("payloads"); set => Q("payloads", value); } + + /// + /// Specifies if term positions should be returned. + /// + [JsonIgnore] + public bool? Positions { get => Q("positions"); set => Q("positions", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random). + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Specifies if request is real-time as opposed to near-real-time (default: true). + /// + [JsonIgnore] + public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } + + /// + /// Specific routing value. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specifies if total term frequency and document frequency should be returned. + /// + [JsonIgnore] + public bool? TermStatistics { get => Q("term_statistics"); set => Q("term_statistics", value); } + + /// + /// Explicit version number for concurrency control + /// + [JsonIgnore] + public long? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Specific version type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } + [JsonInclude, JsonPropertyName("doc")] + public TDocument? Doc { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? Filter { get; set; } + [JsonInclude, JsonPropertyName("per_field_analyzer")] + public IDictionary? PerFieldAnalyzer { get; set; } +} + +/// +/// Returns information and statistics about terms in the fields of a particular document. +/// +public sealed partial class TermVectorsRequestDescriptor : RequestDescriptor, TermVectorsRequestParameters> +{ + internal TermVectorsRequestDescriptor(Action> configure) => configure.Invoke(this); + + internal TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) + { + } + + public TermVectorsRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) => DocumentValue = document; + public TermVectorsRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) => DocumentValue = document; + public TermVectorsRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) => DocumentValue = document; + public TermVectorsRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) => DocumentValue = document; + + public TermVectorsRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal TermVectorsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "termvectors"; + + public TermVectorsRequestDescriptor FieldStatistics(bool? fieldStatistics = true) => Qs("field_statistics", fieldStatistics); + public TermVectorsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public TermVectorsRequestDescriptor Offsets(bool? offsets = true) => Qs("offsets", offsets); + public TermVectorsRequestDescriptor Payloads(bool? payloads = true) => Qs("payloads", payloads); + public TermVectorsRequestDescriptor Positions(bool? positions = true) => Qs("positions", positions); + public TermVectorsRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public TermVectorsRequestDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); + public TermVectorsRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public TermVectorsRequestDescriptor TermStatistics(bool? termStatistics = true) => Qs("term_statistics", termStatistics); + public TermVectorsRequestDescriptor Version(long? version) => Qs("version", version); + public TermVectorsRequestDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) => Qs("version_type", versionType); + + public TermVectorsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + public TermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private TDocument? DocValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? FilterValue { get; set; } + private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private IDictionary? PerFieldAnalyzerValue { get; set; } + private TDocument DocumentValue { get; set; } + + public TermVectorsRequestDescriptor Doc(TDocument? doc) + { + DocValue = doc; + return Self; + } + + public TermVectorsRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TermVectorsRequestDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TermVectorsRequestDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public TermVectorsRequestDescriptor PerFieldAnalyzer(Func, FluentDictionary> selector) + { + PerFieldAnalyzerValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + JsonSerializer.Serialize(writer, DocValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (PerFieldAnalyzerValue is not null) + { + writer.WritePropertyName("per_field_analyzer"); + JsonSerializer.Serialize(writer, PerFieldAnalyzerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs new file mode 100644 index 00000000000..0254a348cb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TermVectorsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("term_vectors")] + [ReadOnlyFieldDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.TermVector))] + public IReadOnlyDictionary? TermVectors { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs new file mode 100644 index 00000000000..a43c6a78724 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs @@ -0,0 +1,465 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class TermsEnumRequestParameters : RequestParameters +{ +} + +/// +/// 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. +/// +public sealed partial class TermsEnumRequest : PlainRequest +{ + public TermsEnumRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "terms_enum"; + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// How many matching terms to return. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// The maximum length of time to spend collecting results. Defaults to "1s" (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } + + /// + /// When true the provided search string is matched against index terms without case sensitivity. + /// + [JsonInclude, JsonPropertyName("case_insensitive")] + public bool? CaseInsensitive { get; set; } + + /// + /// Allows to filter an index shard if the provided query rewrites to match_none. + /// + [JsonInclude, JsonPropertyName("index_filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilter { get; set; } + + /// + /// The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request. + /// + [JsonInclude, JsonPropertyName("string")] + public string? String { get; set; } + [JsonInclude, JsonPropertyName("search_after")] + public string? SearchAfter { get; set; } +} + +/// +/// 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. +/// +public sealed partial class TermsEnumRequestDescriptor : RequestDescriptor, TermsEnumRequestParameters> +{ + internal TermsEnumRequestDescriptor(Action> configure) => configure.Invoke(this); + + public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + public TermsEnumRequestDescriptor(TDocument document) : this(typeof(TDocument)) + { + } + + internal TermsEnumRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "terms_enum"; + + public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } + private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? SearchAfterValue { get; set; } + private int? SizeValue { get; set; } + private string? StringValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Allows to filter an index shard if the provided query rewrites to match_none. + /// + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? indexFilter) + { + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = null; + IndexFilterValue = indexFilter; + return Self; + } + + public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + { + IndexFilterValue = null; + IndexFilterDescriptorAction = null; + IndexFilterDescriptor = descriptor; + return Self; + } + + public TermsEnumRequestDescriptor IndexFilter(Action> configure) + { + IndexFilterValue = null; + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = configure; + return Self; + } + + /// + /// When true the provided search string is matched against index terms without case sensitivity. + /// + public TermsEnumRequestDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + public TermsEnumRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + public TermsEnumRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsEnumRequestDescriptor SearchAfter(string? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// How many matching terms to return. + /// + public TermsEnumRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request. + /// + public TermsEnumRequestDescriptor String(string? value) + { + StringValue = value; + return Self; + } + + /// + /// The maximum length of time to spend collecting results. Defaults to "1s" (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty. + /// + public TermsEnumRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexFilterDescriptor is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterDescriptor, options); + } + else if (IndexFilterDescriptorAction is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + } + else if (IndexFilterValue is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterValue, options); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(SearchAfterValue)) + { + writer.WritePropertyName("search_after"); + writer.WriteStringValue(SearchAfterValue); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (!string.IsNullOrEmpty(StringValue)) + { + writer.WritePropertyName("string"); + writer.WriteStringValue(StringValue); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// 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. +/// +public sealed partial class TermsEnumRequestDescriptor : RequestDescriptor +{ + internal TermsEnumRequestDescriptor(Action configure) => configure.Invoke(this); + + public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal TermsEnumRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "terms_enum"; + + public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } + private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? SearchAfterValue { get; set; } + private int? SizeValue { get; set; } + private string? StringValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Allows to filter an index shard if the provided query rewrites to match_none. + /// + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? indexFilter) + { + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = null; + IndexFilterValue = indexFilter; + return Self; + } + + public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + { + IndexFilterValue = null; + IndexFilterDescriptorAction = null; + IndexFilterDescriptor = descriptor; + return Self; + } + + public TermsEnumRequestDescriptor IndexFilter(Action configure) + { + IndexFilterValue = null; + IndexFilterDescriptor = null; + IndexFilterDescriptorAction = configure; + return Self; + } + + /// + /// When true the provided search string is matched against index terms without case sensitivity. + /// + public TermsEnumRequestDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + public TermsEnumRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + public TermsEnumRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The string to match at the start of indexed terms. If not provided, all terms in the field are considered. + /// + public TermsEnumRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsEnumRequestDescriptor SearchAfter(string? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// How many matching terms to return. + /// + public TermsEnumRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request. + /// + public TermsEnumRequestDescriptor String(string? value) + { + StringValue = value; + return Self; + } + + /// + /// The maximum length of time to spend collecting results. Defaults to "1s" (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty. + /// + public TermsEnumRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexFilterDescriptor is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterDescriptor, options); + } + else if (IndexFilterDescriptorAction is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + } + else if (IndexFilterValue is not null) + { + writer.WritePropertyName("index_filter"); + JsonSerializer.Serialize(writer, IndexFilterValue, options); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(SearchAfterValue)) + { + writer.WritePropertyName("search_after"); + writer.WriteStringValue(SearchAfterValue); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (!string.IsNullOrEmpty(StringValue)) + { + writer.WritePropertyName("string"); + writer.WriteStringValue(StringValue); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs new file mode 100644 index 00000000000..a6eca53a974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TermsEnumResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("complete")] + public bool Complete { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("terms")] + public IReadOnlyCollection Terms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs new file mode 100644 index 00000000000..4e3743cc2af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs @@ -0,0 +1,751 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class UpdateByQueryRequestParameters : RequestParameters +{ + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Starting offset (default: 0) + /// + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Ingest pipeline to set on index requests made by this action. (default: none) + /// + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Should the affected indexes be refreshed? + /// + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to index level setting + /// + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// The throttle to set on this request in sub-requests per second. -1 means no throttle. + /// + public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } + + /// + /// A comma-separated list of specific routing values + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specify how long a consistent view of the index should be maintained for scrolled search + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Size on the scroll request powering the update by query + /// + public long? ScrollSize { get => Q("scroll_size"); set => Q("scroll_size", value); } + + /// + /// Explicit timeout for each search request. Defaults to no timeout. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? SearchTimeout { get => Q("search_timeout"); set => Q("search_timeout", value); } + + /// + /// Search operation type + /// + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Slices? Slices { get => Q("slices"); set => Q("slices", value); } + + /// + /// A comma-separated list of : pairs + /// + public ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } + + /// + /// Specific 'tag' of the request for logging and statistical purposes + /// + public ICollection? Stats { get => Q?>("stats"); set => Q("stats", value); } + + /// + /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + /// + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Time each individual bulk request should wait for shards that are unavailable. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specify whether to return document version as part of a hit + /// + public bool? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Should the document increment the version number (internal) on hit or not (reindex) + /// + public bool? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Should the request should block until the update by query operation is complete. + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+///
+public sealed partial class UpdateByQueryRequest : PlainRequest +{ + public UpdateByQueryRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "update_by_query"; + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + /// + [JsonIgnore] + public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); } + + /// + /// The analyzer to use for the query string + /// + [JsonIgnore] + public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); } + + /// + /// Specify whether wildcard and prefix queries should be analyzed (default: false) + /// + [JsonIgnore] + public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); } + + /// + /// The default operator for query string query (AND or OR) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } + + /// + /// The field to use as default where no field prefix is given in the query string + /// + [JsonIgnore] + public string? Df { get => Q("df"); set => Q("df", value); } + + /// + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// + [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// Starting offset (default: 0) + /// + [JsonIgnore] + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Whether specified concrete indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Ingest pipeline to set on index requests made by this action. (default: none) + /// + [JsonIgnore] + public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } + + /// + /// Specify the node or shard the operation should be performed on (default: random) + /// + [JsonIgnore] + public string? Preference { get => Q("preference"); set => Q("preference", value); } + + /// + /// Should the affected indexes be refreshed? + /// + [JsonIgnore] + public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// Specify if request cache should be used for this request or not, defaults to index level setting + /// + [JsonIgnore] + public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); } + + /// + /// The throttle to set on this request in sub-requests per second. -1 means no throttle. + /// + [JsonIgnore] + public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } + + /// + /// A comma-separated list of specific routing values + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Specify how long a consistent view of the index should be maintained for scrolled search + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); } + + /// + /// Size on the scroll request powering the update by query + /// + [JsonIgnore] + public long? ScrollSize { get => Q("scroll_size"); set => Q("scroll_size", value); } + + /// + /// Explicit timeout for each search request. Defaults to no timeout. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? SearchTimeout { get => Q("search_timeout"); set => Q("search_timeout", value); } + + /// + /// Search operation type + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); } + + /// + /// The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Slices? Slices { get => Q("slices"); set => Q("slices", value); } + + /// + /// A comma-separated list of : pairs + /// + [JsonIgnore] + public ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } + + /// + /// Specific 'tag' of the request for logging and statistical purposes + /// + [JsonIgnore] + public ICollection? Stats { get => Q?>("stats"); set => Q("stats", value); } + + /// + /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + /// + [JsonIgnore] + public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } + + /// + /// Time each individual bulk request should wait for shards that are unavailable. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specify whether to return document version as part of a hit + /// + [JsonIgnore] + public bool? Version { get => Q("version"); set => Q("version", value); } + + /// + /// Should the document increment the version number (internal) on hit or not (reindex) + /// + [JsonIgnore] + public bool? VersionType { get => Q("version_type"); set => Q("version_type", value); } + + /// + /// Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Should the request should block until the update by query operation is complete. + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + [JsonInclude, JsonPropertyName("max_docs")] + public long? MaxDocs { get; set; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("slice")] + public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; } + [JsonInclude, JsonPropertyName("conflicts")] + public Elastic.Clients.Elasticsearch.Serverless.Conflicts? Conflicts { get; set; } +} + +/// +/// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+///
+public sealed partial class UpdateByQueryRequestDescriptor : RequestDescriptor, UpdateByQueryRequestParameters> +{ + internal UpdateByQueryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal UpdateByQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "update_by_query"; + + public UpdateByQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateByQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public UpdateByQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public UpdateByQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public UpdateByQueryRequestDescriptor Df(string? df) => Qs("df", df); + public UpdateByQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateByQueryRequestDescriptor From(long? from) => Qs("from", from); + public UpdateByQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public UpdateByQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public UpdateByQueryRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public UpdateByQueryRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public UpdateByQueryRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public UpdateByQueryRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public UpdateByQueryRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); + public UpdateByQueryRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public UpdateByQueryRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public UpdateByQueryRequestDescriptor ScrollSize(long? scrollSize) => Qs("scroll_size", scrollSize); + public UpdateByQueryRequestDescriptor SearchTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? searchTimeout) => Qs("search_timeout", searchTimeout); + public UpdateByQueryRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public UpdateByQueryRequestDescriptor Slices(Elastic.Clients.Elasticsearch.Serverless.Slices? slices) => Qs("slices", slices); + public UpdateByQueryRequestDescriptor Sort(ICollection? sort) => Qs("sort", sort); + public UpdateByQueryRequestDescriptor Stats(ICollection? stats) => Qs("stats", stats); + public UpdateByQueryRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + public UpdateByQueryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public UpdateByQueryRequestDescriptor Version(bool? version = true) => Qs("version", version); + public UpdateByQueryRequestDescriptor VersionType(bool? versionType = true) => Qs("version_type", versionType); + public UpdateByQueryRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public UpdateByQueryRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } + private long? MaxDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateByQueryRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(Action> configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public UpdateByQueryRequestDescriptor Conflicts(Elastic.Clients.Elasticsearch.Serverless.Conflicts? conflicts) + { + ConflictsValue = conflicts; + return Self; + } + + public UpdateByQueryRequestDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + public UpdateByQueryRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (ConflictsValue is not null) + { + writer.WritePropertyName("conflicts"); + JsonSerializer.Serialize(writer, ConflictsValue, options); + } + + if (MaxDocsValue.HasValue) + { + writer.WritePropertyName("max_docs"); + writer.WriteNumberValue(MaxDocsValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+///
+public sealed partial class UpdateByQueryRequestDescriptor : RequestDescriptor +{ + internal UpdateByQueryRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal UpdateByQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "update_by_query"; + + public UpdateByQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateByQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public UpdateByQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public UpdateByQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public UpdateByQueryRequestDescriptor Df(string? df) => Qs("df", df); + public UpdateByQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateByQueryRequestDescriptor From(long? from) => Qs("from", from); + public UpdateByQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public UpdateByQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public UpdateByQueryRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline); + public UpdateByQueryRequestDescriptor Preference(string? preference) => Qs("preference", preference); + public UpdateByQueryRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); + public UpdateByQueryRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache); + public UpdateByQueryRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); + public UpdateByQueryRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public UpdateByQueryRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll); + public UpdateByQueryRequestDescriptor ScrollSize(long? scrollSize) => Qs("scroll_size", scrollSize); + public UpdateByQueryRequestDescriptor SearchTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? searchTimeout) => Qs("search_timeout", searchTimeout); + public UpdateByQueryRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType); + public UpdateByQueryRequestDescriptor Slices(Elastic.Clients.Elasticsearch.Serverless.Slices? slices) => Qs("slices", slices); + public UpdateByQueryRequestDescriptor Sort(ICollection? sort) => Qs("sort", sort); + public UpdateByQueryRequestDescriptor Stats(ICollection? stats) => Qs("stats", stats); + public UpdateByQueryRequestDescriptor TerminateAfter(long? terminateAfter) => Qs("terminate_after", terminateAfter); + public UpdateByQueryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public UpdateByQueryRequestDescriptor Version(bool? version = true) => Qs("version", version); + public UpdateByQueryRequestDescriptor VersionType(bool? versionType = true) => Qs("version_type", versionType); + public UpdateByQueryRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + public UpdateByQueryRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } + private SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } + private long? MaxDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateByQueryRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? slice) + { + SliceDescriptor = null; + SliceDescriptorAction = null; + SliceValue = slice; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + { + SliceValue = null; + SliceDescriptorAction = null; + SliceDescriptor = descriptor; + return Self; + } + + public UpdateByQueryRequestDescriptor Slice(Action configure) + { + SliceValue = null; + SliceDescriptor = null; + SliceDescriptorAction = configure; + return Self; + } + + public UpdateByQueryRequestDescriptor Conflicts(Elastic.Clients.Elasticsearch.Serverless.Conflicts? conflicts) + { + ConflictsValue = conflicts; + return Self; + } + + public UpdateByQueryRequestDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + public UpdateByQueryRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SliceDescriptor is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceDescriptor, options); + } + else if (SliceDescriptorAction is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + } + else if (SliceValue is not null) + { + writer.WritePropertyName("slice"); + JsonSerializer.Serialize(writer, SliceValue, options); + } + + if (ConflictsValue is not null) + { + writer.WritePropertyName("conflicts"); + JsonSerializer.Serialize(writer, ConflictsValue, options); + } + + if (MaxDocsValue.HasValue) + { + writer.WritePropertyName("max_docs"); + writer.WriteNumberValue(MaxDocsValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs new file mode 100644 index 00000000000..1f724261c93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class UpdateByQueryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("batches")] + public long? Batches { get; init; } + [JsonInclude, JsonPropertyName("deleted")] + public long? Deleted { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("noops")] + public long? Noops { get; init; } + [JsonInclude, JsonPropertyName("requests_per_second")] + public float? RequestsPerSecond { get; init; } + [JsonInclude, JsonPropertyName("retries")] + public Elastic.Clients.Elasticsearch.Serverless.Retries? Retries { get; init; } + [JsonInclude, JsonPropertyName("task")] + public Elastic.Clients.Elasticsearch.Serverless.TaskId? Task { get; init; } + [JsonInclude, JsonPropertyName("throttled")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Throttled { get; init; } + [JsonInclude, JsonPropertyName("throttled_millis")] + public long? ThrottledMillis { get; init; } + [JsonInclude, JsonPropertyName("throttled_until")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ThrottledUntil { get; init; } + [JsonInclude, JsonPropertyName("throttled_until_millis")] + public long? ThrottledUntilMillis { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool? TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long? Took { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long? Total { get; init; } + [JsonInclude, JsonPropertyName("updated")] + public long? Updated { get; init; } + [JsonInclude, JsonPropertyName("version_conflicts")] + public long? VersionConflicts { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs new file mode 100644 index 00000000000..0f40b80daa7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs @@ -0,0 +1,403 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed class UpdateRequestParameters : RequestParameters +{ + /// + /// Only perform the operation if the document has this primary term. + /// + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// Only perform the operation if the document has this sequence number. + /// + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// The script language. + /// + public string? Lang { get => Q("lang"); set => Q("lang", value); } + + /// + /// If 'true', Elasticsearch refreshes the affected shards to make this operation
visible to search, if 'wait_for' then wait for a refresh to make this operation
visible to search, if 'false' do nothing with refreshes.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// If true, the destination must be an index alias. + /// + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } + + /// + /// Specify how many times should the operation be retried when a conflict occurs. + /// + public int? RetryOnConflict { get => Q("retry_on_conflict"); set => Q("retry_on_conflict", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Period to wait for dynamic mapping updates and active shards.
This guarantees Elasticsearch waits for at least the timeout before failing.
The actual wait time could be longer, particularly when multiple waits occur.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// The number of shard copies that must be active before proceeding with the operations.
Set to 'all' or any positive integer up to the total number of shards in the index
(number_of_replicas+1). Defaults to 1 meaning the primary shard.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Specify the source fields you want to exclude. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// Specify the source fields you want to retrieve. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } +} + +/// +/// Updates a document with a script or partial document. +/// +public sealed partial class UpdateRequest : PlainRequest +{ + public UpdateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "update"; + + /// + /// Only perform the operation if the document has this primary term. + /// + [JsonIgnore] + public long? IfPrimaryTerm { get => Q("if_primary_term"); set => Q("if_primary_term", value); } + + /// + /// Only perform the operation if the document has this sequence number. + /// + [JsonIgnore] + public long? IfSeqNo { get => Q("if_seq_no"); set => Q("if_seq_no", value); } + + /// + /// The script language. + /// + [JsonIgnore] + public string? Lang { get => Q("lang"); set => Q("lang", value); } + + /// + /// If 'true', Elasticsearch refreshes the affected shards to make this operation
visible to search, if 'wait_for' then wait for a refresh to make this operation
visible to search, if 'false' do nothing with refreshes.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } + + /// + /// If true, the destination must be an index alias. + /// + [JsonIgnore] + public bool? RequireAlias { get => Q("require_alias"); set => Q("require_alias", value); } + + /// + /// Specify how many times should the operation be retried when a conflict occurs. + /// + [JsonIgnore] + public int? RetryOnConflict { get => Q("retry_on_conflict"); set => Q("retry_on_conflict", value); } + + /// + /// Custom value used to route operations to a specific shard. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + /// + /// Period to wait for dynamic mapping updates and active shards.
This guarantees Elasticsearch waits for at least the timeout before failing.
The actual wait time could be longer, particularly when multiple waits occur.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// The number of shard copies that must be active before proceeding with the operations.
Set to 'all' or any positive integer up to the total number of shards in the index
(number_of_replicas+1). Defaults to 1 meaning the primary shard.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + + /// + /// Specify the source fields you want to exclude. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); } + + /// + /// Specify the source fields you want to retrieve. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); } + + /// + /// Set to false to disable setting 'result' in the response
to 'noop' if no change to the document occurred.
+ ///
+ [JsonInclude, JsonPropertyName("detect_noop")] + public bool? DetectNoop { get; set; } + + /// + /// A partial update to an existing document. + /// + [JsonInclude, JsonPropertyName("doc")] + [SourceConverter] + public TPartialDocument? Doc { get; set; } + + /// + /// Set to true to use the contents of 'doc' as the value of 'upsert' + /// + [JsonInclude, JsonPropertyName("doc_as_upsert")] + public bool? DocAsUpsert { get; set; } + + /// + /// Script to execute to update the document. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Set to true to execute the script whether or not the document exists. + /// + [JsonInclude, JsonPropertyName("scripted_upsert")] + public bool? ScriptedUpsert { get; set; } + + /// + /// Set to false to disable source retrieval. You can also specify a comma-separated
list of the fields you want to retrieve.
+ ///
+ [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + + /// + /// If the document does not already exist, the contents of 'upsert' are inserted as a
new document. If the document exists, the 'script' is executed.
+ ///
+ [JsonInclude, JsonPropertyName("upsert")] + [SourceConverter] + public TDocument? Upsert { get; set; } +} + +/// +/// Updates a document with a script or partial document. +/// +public sealed partial class UpdateRequestDescriptor : RequestDescriptor, UpdateRequestParameters> +{ + internal UpdateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) + { + } + + public UpdateRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) + { + } + + public UpdateRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) + { + } + + public UpdateRequestDescriptor(Id id) : this(typeof(TDocument), id) + { + } + + internal UpdateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "update"; + + public UpdateRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes); + public UpdateRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes); + public UpdateRequestDescriptor IfPrimaryTerm(long? ifPrimaryTerm) => Qs("if_primary_term", ifPrimaryTerm); + public UpdateRequestDescriptor IfSeqNo(long? ifSeqNo) => Qs("if_seq_no", ifSeqNo); + public UpdateRequestDescriptor Lang(string? lang) => Qs("lang", lang); + public UpdateRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh); + public UpdateRequestDescriptor RequireAlias(bool? requireAlias = true) => Qs("require_alias", requireAlias); + public UpdateRequestDescriptor RetryOnConflict(int? retryOnConflict) => Qs("retry_on_conflict", retryOnConflict); + public UpdateRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing); + public UpdateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public UpdateRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public UpdateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + public UpdateRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? DetectNoopValue { get; set; } + private TPartialDocument? DocValue { get; set; } + private bool? DocAsUpsertValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private bool? ScriptedUpsertValue { get; set; } + private TDocument? UpsertValue { get; set; } + + /// + /// Set to false to disable source retrieval. You can also specify a comma-separated
list of the fields you want to retrieve.
+ ///
+ public UpdateRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// Set to false to disable setting 'result' in the response
to 'noop' if no change to the document occurred.
+ ///
+ public UpdateRequestDescriptor DetectNoop(bool? detectNoop = true) + { + DetectNoopValue = detectNoop; + return Self; + } + + /// + /// A partial update to an existing document. + /// + public UpdateRequestDescriptor Doc(TPartialDocument? doc) + { + DocValue = doc; + return Self; + } + + /// + /// Set to true to use the contents of 'doc' as the value of 'upsert' + /// + public UpdateRequestDescriptor DocAsUpsert(bool? docAsUpsert = true) + { + DocAsUpsertValue = docAsUpsert; + return Self; + } + + /// + /// Script to execute to update the document. + /// + public UpdateRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Set to true to execute the script whether or not the document exists. + /// + public UpdateRequestDescriptor ScriptedUpsert(bool? scriptedUpsert = true) + { + ScriptedUpsertValue = scriptedUpsert; + return Self; + } + + /// + /// If the document does not already exist, the contents of 'upsert' are inserted as a
new document. If the document exists, the 'script' is executed.
+ ///
+ public UpdateRequestDescriptor Upsert(TDocument? upsert) + { + UpsertValue = upsert; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (DetectNoopValue.HasValue) + { + writer.WritePropertyName("detect_noop"); + writer.WriteBooleanValue(DetectNoopValue.Value); + } + + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + SourceSerialization.Serialize(DocValue, writer, settings); + } + + if (DocAsUpsertValue.HasValue) + { + writer.WritePropertyName("doc_as_upsert"); + writer.WriteBooleanValue(DocAsUpsertValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ScriptedUpsertValue.HasValue) + { + writer.WritePropertyName("scripted_upsert"); + writer.WriteBooleanValue(ScriptedUpsertValue.Value); + } + + if (UpsertValue is not null) + { + writer.WritePropertyName("upsert"); + SourceSerialization.Serialize(UpsertValue, writer, settings); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs new file mode 100644 index 00000000000..ae4b4cf4093 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs @@ -0,0 +1,48 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class UpdateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("get")] + public Elastic.Clients.Elasticsearch.Serverless.InlineGet? Get { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs new file mode 100644 index 00000000000..967ed9248be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs @@ -0,0 +1,470 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public partial class AsyncSearchNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected AsyncSearchNamespacedClient() : base() + { + } + + internal AsyncSearchNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(AsyncSearchStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteAsyncSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequest request) + { + request.BeforeRequest(); + return DoRequest, GetAsyncSearchRequestParameters>(request); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetAsyncSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetAsyncSearchRequestParameters>(request, cancellationToken); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetAsyncSearchRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetAsyncSearchRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves the results of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetAsyncSearchRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequest request) + { + request.BeforeRequest(); + return DoRequest, SubmitAsyncSearchRequestParameters>(request); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SubmitAsync(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, SubmitAsyncSearchRequestParameters>(request, cancellationToken); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SubmitAsyncSearchResponse Submit() + { + var descriptor = new SubmitAsyncSearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SubmitAsyncSearchResponse Submit(Action> configureRequest) + { + var descriptor = new SubmitAsyncSearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SubmitAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SubmitAsyncSearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SubmitAsync(SubmitAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Executes a search request asynchronously. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SubmitAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SubmitAsyncSearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs new file mode 100644 index 00000000000..73af3674b6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs @@ -0,0 +1,512 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public partial class ClusterNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected ClusterNamespacedClient() : base() + { + } + + internal ClusterNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task AllocationExplainAsync(AllocationExplainRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AllocationExplainResponse AllocationExplain() + { + var descriptor = new AllocationExplainRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual AllocationExplainResponse AllocationExplain(Action configureRequest) + { + var descriptor = new AllocationExplainRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task AllocationExplainAsync(CancellationToken cancellationToken = default) + { + var descriptor = new AllocationExplainRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task AllocationExplainAsync(AllocationExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides explanations for shard allocations in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task AllocationExplainAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new AllocationExplainRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(ClusterStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClusterStatsResponse Stats() + { + var descriptor = new ClusterStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClusterStatsResponse Stats(ClusterStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClusterStatsResponse Stats(Action configureRequest) + { + var descriptor = new ClusterStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ClusterStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(ClusterStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClusterStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSettingsAsync(GetClusterSettingsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetClusterSettingsResponse GetSettings() + { + var descriptor = new GetClusterSettingsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetClusterSettingsResponse GetSettings(Action configureRequest) + { + var descriptor = new GetClusterSettingsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSettingsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetClusterSettingsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSettingsAsync(GetClusterSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSettingsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetClusterSettingsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health(HealthRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(HealthRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health() + { + var descriptor = new HealthRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health(HealthRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health(Action configureRequest) + { + var descriptor = new HealthRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health(HealthRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HealthResponse Health(Action> configureRequest) + { + var descriptor = new HealthRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(CancellationToken cancellationToken = default) + { + var descriptor = new HealthRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new HealthRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new HealthRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual PendingTasksResponse PendingTasks(PendingTasksRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task PendingTasksAsync(PendingTasksRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual PendingTasksResponse PendingTasks() + { + var descriptor = new PendingTasksRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual PendingTasksResponse PendingTasks(PendingTasksRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual PendingTasksResponse PendingTasks(Action configureRequest) + { + var descriptor = new PendingTasksRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task PendingTasksAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PendingTasksRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task PendingTasksAsync(PendingTasksRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task PendingTasksAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PendingTasksRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs new file mode 100644 index 00000000000..03ff6665e56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs @@ -0,0 +1,490 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public partial class EnrichNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected EnrichNamespacedClient() : base() + { + } + + internal EnrichNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePolicyResponse DeletePolicy(DeletePolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePolicyAsync(DeletePolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new DeletePolicyRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePolicyResponse DeletePolicy(DeletePolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new DeletePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeletePolicyRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePolicyAsync(DeletePolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing enrich policy and its enrich index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeletePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EnrichStatsResponse Stats(EnrichStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(EnrichStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EnrichStatsResponse Stats() + { + var descriptor = new EnrichStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EnrichStatsResponse Stats(EnrichStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EnrichStatsResponse Stats(Action configureRequest) + { + var descriptor = new EnrichStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new EnrichStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(EnrichStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets enrich coordinator statistics and information about enrich policies that are currently executing. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecutePolicyAsync(ExecutePolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new ExecutePolicyRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new ExecutePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new ExecutePolicyRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecutePolicyAsync(ExecutePolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates the enrich index for an existing enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExecutePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPolicyResponse GetPolicy(GetPolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPolicyAsync(GetPolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPolicyResponse GetPolicy() + { + var descriptor = new GetPolicyRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPolicyResponse GetPolicy(GetPolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPolicyResponse GetPolicy(Action configureRequest) + { + var descriptor = new GetPolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPolicyAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetPolicyRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPolicyAsync(GetPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets information about an enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPolicyAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetPolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPolicyResponse PutPolicy(PutPolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPolicyAsync(PutPolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new PutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutPolicyResponse, PutPolicyRequestParameters>(descriptor); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest) + { + var descriptor = new PutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutPolicyResponse, PutPolicyRequestParameters>(descriptor); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new enrich policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs new file mode 100644 index 00000000000..cbebf026f0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs @@ -0,0 +1,168 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public partial class GraphNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected GraphNamespacedClient() : base() + { + } + + internal GraphNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(ExploreRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(ExploreRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new ExploreRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new ExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExploreResponse, ExploreRequestParameters>(descriptor); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new ExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExploreResponse, ExploreRequestParameters>(descriptor); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new ExploreRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(ExploreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(ExploreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExploreResponse, ExploreRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explore extracted and summarized information about the documents and terms in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExploreResponse, ExploreRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs new file mode 100644 index 00000000000..3ba62e35ef6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -0,0 +1,3618 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public partial class IndicesNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected IndicesNamespacedClient() : base() + { + } + + internal IndicesNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(CloseIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, CloseIndexResponse, CloseIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloseIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CloseIndexResponse, CloseIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateDataStreamAsync(CreateDataStreamRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name) + { + var descriptor = new CreateDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, Action configureRequest) + { + var descriptor = new CreateDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, CancellationToken cancellationToken = default) + { + var descriptor = new CreateDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateDataStreamAsync(CreateDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(CreateIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + var descriptor = new CreateIndexRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest) + { + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create() + { + var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(Action> configureRequest) + { + var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + { + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(DeleteAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name, Action> configureRequest) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(DeleteAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(DeleteAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Names name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest) + { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Deletes the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + var descriptor = new DeleteDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest) + { + var descriptor = new DeleteDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(DeleteIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(DeleteIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(DeleteIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest) + { + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTemplateAsync(DeleteTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new DeleteTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new DeleteTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTemplateAsync(DeleteTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(ExistsAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Serverless.Names name, Action> configureRequest) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(ExistsAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(ExistsAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsAliasRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(ExistsIndexTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(ExistsIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new ExistsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new ExistsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new ExistsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsTemplateAsync(ExistsTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + var descriptor = new ExistsTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest) + { + var descriptor = new ExistsTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsTemplateAsync(ExistsTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias(GetAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(GetAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias() + { + var descriptor = new GetAliasRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias(Action configureRequest) + { + var descriptor = new GetAliasRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAliasResponse GetAlias(Action> configureRequest) + { + var descriptor = new GetAliasRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetAliasRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetAliasRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAliasAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetAliasRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Returns the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataStreamAsync(GetDataStreamRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataStreamResponse GetDataStream() + { + var descriptor = new GetDataStreamRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataStreamResponse GetDataStream(Action configureRequest) + { + var descriptor = new GetDataStreamRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataStreamAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDataStreamRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataStreamAsync(GetDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataStreamRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(GetIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new GetIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new GetIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new GetIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexTemplateResponse GetIndexTemplate() + { + var descriptor = new GetIndexTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIndexTemplateResponse GetIndexTemplate(Action configureRequest) + { + var descriptor = new GetIndexTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping(GetMappingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(GetMappingRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping() + { + var descriptor = new GetMappingRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping(Action configureRequest) + { + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMappingResponse GetMapping(Action> configureRequest) + { + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetMappingRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMappingAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTemplateResponse GetTemplate() + { + var descriptor = new GetTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTemplateResponse GetTemplate(GetTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTemplateResponse GetTemplate(Action configureRequest) + { + var descriptor = new GetTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTemplateAsync(GetTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats(IndicesStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(IndicesStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats() + { + var descriptor = new IndicesStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats(Action configureRequest) + { + var descriptor = new IndicesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndicesStatsResponse Stats(Action> configureRequest) + { + var descriptor = new IndicesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new IndicesStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new IndicesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new IndicesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.Serverless.IndexName name) + { + var descriptor = new MigrateToDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.Serverless.IndexName name, Action configureRequest) + { + var descriptor = new MigrateToDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName name, CancellationToken cancellationToken = default) + { + var descriptor = new MigrateToDataStreamRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Migrates an alias to a data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MigrateToDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(OpenIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(OpenIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(OpenIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(OpenIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, OpenIndexResponse, OpenIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, OpenIndexResponse, OpenIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(PutAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(PutAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + { + var descriptor = new PutDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest) + { + var descriptor = new PutDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. + /// Updates the data lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest) + { + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutMappingResponse PutMapping(PutMappingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutMappingAsync(PutMappingRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTemplateResponse PutTemplate(PutTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new PutTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual RolloverResponse Rollover(RolloverRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task RolloverAsync(RolloverRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) + { + var descriptor = new RolloverRequestDescriptor(alias); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Action configureRequest) + { + var descriptor = new RolloverRequestDescriptor(alias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, CancellationToken cancellationToken = default) + { + var descriptor = new RolloverRequestDescriptor(alias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RolloverRequestDescriptor(alias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Simulate matching the given index name against the index templates in the system + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateTemplateAsync(SimulateTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateTemplateResponse SimulateTemplate() + { + var descriptor = new SimulateTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateTemplateResponse SimulateTemplate(Action configureRequest) + { + var descriptor = new SimulateTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SimulateTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateAliasesAsync(UpdateAliasesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateAliasesResponse UpdateAliases(Action configureRequest) + { + var descriptor = new UpdateAliasesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateAliasesResponse UpdateAliases(Action> configureRequest) + { + var descriptor = new UpdateAliasesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateAliasesAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateAliasesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates index aliases. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateAliasesAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateAliasesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs new file mode 100644 index 00000000000..e99c2f11d69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -0,0 +1,708 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public partial class IngestNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected IngestNamespacedClient() : base() + { + } + + internal IngestNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(DeletePipelineRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(DeletePipelineRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(DeletePipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(DeletePipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeletePipelineResponse, DeletePipelineRequestParameters>(descriptor); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeletePipelineResponse, DeletePipelineRequestParameters>(descriptor); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(DeletePipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(DeletePipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeletePipelineResponse, DeletePipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeletePipelineAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeletePipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeletePipelineResponse, DeletePipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GeoIpStatsAsync(GeoIpStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GeoIpStatsResponse GeoIpStats() + { + var descriptor = new GeoIpStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GeoIpStatsResponse GeoIpStats(Action configureRequest) + { + var descriptor = new GeoIpStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GeoIpStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GeoIpStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GeoIpStatsAsync(GeoIpStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about geoip databases + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GeoIpStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GeoIpStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline(GetPipelineRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(GetPipelineRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline() + { + var descriptor = new GetPipelineRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline(GetPipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline(Action configureRequest) + { + var descriptor = new GetPipelineRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline(GetPipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetPipelineResponse, GetPipelineRequestParameters>(descriptor); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetPipelineResponse GetPipeline(Action> configureRequest) + { + var descriptor = new GetPipelineRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetPipelineResponse, GetPipelineRequestParameters>(descriptor); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetPipelineRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(GetPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetPipelineRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(GetPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetPipelineResponse, GetPipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetPipelineAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetPipelineRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetPipelineResponse, GetPipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ProcessorGrokAsync(ProcessorGrokRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ProcessorGrokResponse ProcessorGrok() + { + var descriptor = new ProcessorGrokRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ProcessorGrokResponse ProcessorGrok(Action configureRequest) + { + var descriptor = new ProcessorGrokRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ProcessorGrokAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ProcessorGrokRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ProcessorGrokAsync(ProcessorGrokRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a list of the built-in patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ProcessorGrokAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ProcessorGrokRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPipelineResponse PutPipeline(PutPipelineRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPipelineAsync(PutPipelineRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new PutPipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutPipelineResponse, PutPipelineRequestParameters>(descriptor); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new PutPipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutPipelineResponse, PutPipelineRequestParameters>(descriptor); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPipelineAsync(PutPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPipelineAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutPipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPipelineAsync(PutPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutPipelineResponse, PutPipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutPipelineAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutPipelineRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutPipelineResponse, PutPipelineRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate(SimulateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(SimulateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate() + { + var descriptor = new SimulateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate(SimulateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate(Action configureRequest) + { + var descriptor = new SimulateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate(SimulateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SimulateResponse, SimulateRequestParameters>(descriptor); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SimulateResponse Simulate(Action> configureRequest) + { + var descriptor = new SimulateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SimulateResponse, SimulateRequestParameters>(descriptor); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SimulateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(SimulateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(SimulateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SimulateResponse, SimulateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to simulate a pipeline with example documents. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SimulateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SimulateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SimulateResponse, SimulateRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs new file mode 100644 index 00000000000..387ebcd6e7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs @@ -0,0 +1,3771 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; +using Elastic.Clients.Elasticsearch.Serverless.Cluster; +using Elastic.Clients.Elasticsearch.Serverless.Enrich; +using Elastic.Clients.Elasticsearch.Serverless.Graph; +using Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +using Elastic.Clients.Elasticsearch.Serverless.Ingest; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public partial class ElasticsearchClient +{ + public virtual AsyncSearchNamespacedClient AsyncSearch { get; private set; } + public virtual ClusterNamespacedClient Cluster { get; private set; } + public virtual EnrichNamespacedClient Enrich { get; private set; } + public virtual GraphNamespacedClient Graph { get; private set; } + public virtual IndicesNamespacedClient Indices { get; private set; } + public virtual IngestNamespacedClient Ingest { get; private set; } + + private partial void SetupNamespaces() + { + AsyncSearch = new AsyncSearchNamespacedClient(this); Cluster = new ClusterNamespacedClient(this); Enrich = new EnrichNamespacedClient(this); Graph = new GraphNamespacedClient(this); Indices = new IndicesNamespacedClient(this); Ingest = new IngestNamespacedClient(this); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual BulkResponse Bulk(BulkRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task BulkAsync(BulkRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual BulkResponse Bulk(Action configureRequest) + { + var descriptor = new BulkRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, BulkResponse, BulkRequestParameters>(descriptor); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual BulkResponse Bulk(Action> configureRequest) + { + var descriptor = new BulkRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, BulkResponse, BulkRequestParameters>(descriptor); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task BulkAsync(BulkRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task BulkAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new BulkRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task BulkAsync(BulkRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, BulkResponse, BulkRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to perform multiple index/update/delete operations in a single request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task BulkAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new BulkRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, BulkResponse, BulkRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearScrollResponse ClearScroll(ClearScrollRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearScrollAsync(ClearScrollRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearScrollResponse ClearScroll() + { + var descriptor = new ClearScrollRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearScrollResponse ClearScroll(ClearScrollRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearScrollResponse ClearScroll(Action configureRequest) + { + var descriptor = new ClearScrollRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearScrollAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ClearScrollRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearScrollAsync(ClearScrollRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explicitly clears the search context for a scroll. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearScrollAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClearScrollRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClosePointInTimeAsync(ClosePointInTimeRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClosePointInTimeResponse ClosePointInTime() + { + var descriptor = new ClosePointInTimeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClosePointInTimeResponse ClosePointInTime(Action configureRequest) + { + var descriptor = new ClosePointInTimeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClosePointInTimeAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ClosePointInTimeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClosePointInTimeAsync(ClosePointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Close a point in time + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClosePointInTimeAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClosePointInTimeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count(CountRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(CountRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count() + { + var descriptor = new CountRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count(CountRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count(Action configureRequest) + { + var descriptor = new CountRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count(CountRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, CountResponse, CountRequestParameters>(descriptor); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CountResponse Count(Action> configureRequest) + { + var descriptor = new CountRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CountResponse, CountRequestParameters>(descriptor); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CountRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(CountRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CountRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(CountRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, CountResponse, CountRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns number of documents matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CountAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CountRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CountResponse, CountRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateResponse Create(CreateRequest request) + { + request.BeforeRequest(); + return DoRequest, CreateResponse, CreateRequestParameters>(request); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, CreateResponse, CreateRequestParameters>(request, cancellationToken); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateResponse Create(CreateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, CreateResponse, CreateRequestParameters>(descriptor); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateResponse Create(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new CreateRequestDescriptor(document, index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CreateResponse, CreateRequestParameters>(descriptor); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateResponse Create(TDocument document, Action> configureRequest) + { + var descriptor = new CreateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CreateResponse, CreateRequestParameters>(descriptor); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateRequestDescriptor(document, index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new document in the index. + /// Returns a 409 response when a document with a same ID already exists in the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteByQueryAsync(DeleteByQueryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new DeleteByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new DeleteByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteByQueryAsync(DeleteByQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteByQueryAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteByQueryAsync(DeleteByQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes documents matching the provided query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteByQueryAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(DeleteRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new DeleteRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new DeleteRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(DeleteScriptRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(DeleteScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(DeleteScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new ExistsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(ExistsSourceRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps(FieldCapsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(FieldCapsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps() + { + var descriptor = new FieldCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps(Action configureRequest) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, FieldCapsResponse, FieldCapsRequestParameters>(descriptor); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FieldCapsResponse FieldCaps(Action> configureRequest) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, FieldCapsResponse, FieldCapsRequestParameters>(descriptor); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, FieldCapsResponse, FieldCapsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, FieldCapsResponse, FieldCapsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(GetRequest request) + { + request.BeforeRequest(); + return DoRequest, GetRequestParameters>(request); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetRequestParameters>(request, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(GetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(GetScriptRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(GetScriptRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetScriptRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(GetScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new GetScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(GetScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetScriptResponse, GetScriptRequestParameters>(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetScriptResponse GetScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetScriptResponse, GetScriptRequestParameters>(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetScriptRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(GetScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(GetScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetScriptResponse, GetScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetScriptResponse, GetScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(GetSourceRequest request) + { + request.BeforeRequest(); + return DoRequest, GetSourceRequestParameters>(request); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(GetSourceRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetSourceRequestParameters>(request, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(GetSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndexResponse Index(IndexRequest request) + { + request.BeforeRequest(); + return DoRequest, IndexResponse, IndexRequestParameters>(request); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task IndexAsync(IndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(request, cancellationToken); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndexResponse Index(IndexRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, IndexResponse, IndexRequestParameters>(descriptor); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndexResponse Index(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + { + var descriptor = new IndexRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, IndexResponse, IndexRequestParameters>(descriptor); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual IndexResponse Index(TDocument document, Action> configureRequest) + { + var descriptor = new IndexRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, IndexResponse, IndexRequestParameters>(descriptor); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task IndexAsync(IndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task IndexAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new IndexRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task IndexAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new IndexRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InfoResponse Info(InfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(InfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InfoResponse Info() + { + var descriptor = new InfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InfoResponse Info(InfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InfoResponse Info(Action configureRequest) + { + var descriptor = new InfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new InfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(InfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiGetResponse MultiGet(MultiGetRequest request) + { + request.BeforeRequest(); + return DoRequest, MultiGetRequestParameters>(request); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiGetAsync(MultiGetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, MultiGetRequestParameters>(request, cancellationToken); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiGetResponse MultiGet() + { + var descriptor = new MultiGetRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, MultiGetResponse, MultiGetRequestParameters>(descriptor); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiGetResponse MultiGet(MultiGetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, MultiGetResponse, MultiGetRequestParameters>(descriptor); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiGetResponse MultiGet(Action> configureRequest) + { + var descriptor = new MultiGetRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, MultiGetResponse, MultiGetRequestParameters>(descriptor); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiGetAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MultiGetRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiGetResponse, MultiGetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiGetAsync(MultiGetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, MultiGetResponse, MultiGetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiGetAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiGetRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiGetResponse, MultiGetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchResponse MultiSearch(MultiSearchRequest request) + { + request.BeforeRequest(); + return DoRequest, MultiSearchRequestParameters>(request); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchAsync(MultiSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, MultiSearchRequestParameters>(request, cancellationToken); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchResponse MultiSearch() + { + var descriptor = new MultiSearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchResponse MultiSearch(MultiSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchResponse MultiSearch(Action> configureRequest) + { + var descriptor = new MultiSearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MultiSearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchAsync(MultiSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiSearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchTemplateResponse MultiSearchTemplate(MultiSearchTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest, MultiSearchTemplateRequestParameters>(request); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchTemplateAsync(MultiSearchTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(request, cancellationToken); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchTemplateResponse MultiSearchTemplate() + { + var descriptor = new MultiSearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchTemplateResponse MultiSearchTemplate(MultiSearchTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiSearchTemplateResponse MultiSearchTemplate(Action> configureRequest) + { + var descriptor = new MultiSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MultiSearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchTemplateAsync(MultiSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> MultiSearchTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors(MultiTermVectorsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors() + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors(MultiTermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors(Action configureRequest) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors(MultiTermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse MultiTermVectors(Action> configureRequest) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MultiTermVectorsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Open a point in time that can be used in subsequent searches + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenPointInTimeRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PingResponse Ping(PingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PingAsync(PingRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PingResponse Ping() + { + var descriptor = new PingRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PingResponse Ping(PingRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PingResponse Ping(Action configureRequest) + { + var descriptor = new PingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PingAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PingRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PingAsync(PingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns whether the cluster is running. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PingAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutScriptResponse PutScript(PutScriptRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutScriptAsync(PutScriptRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutScriptResponse PutScript(PutScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutScriptResponse PutScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + { + var descriptor = new PutScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutScriptResponse PutScript(PutScriptRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutScriptResponse, PutScriptRequestParameters>(descriptor); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutScriptResponse PutScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new PutScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutScriptResponse, PutScriptRequestParameters>(descriptor); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutScriptAsync(PutScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutScriptAsync(PutScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutScriptResponse, PutScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutScriptRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutScriptResponse, PutScriptRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval(RankEvalRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(RankEvalRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval() + { + var descriptor = new RankEvalRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval(RankEvalRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval(Action configureRequest) + { + var descriptor = new RankEvalRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval(RankEvalRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, RankEvalResponse, RankEvalRequestParameters>(descriptor); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RankEvalResponse RankEval(Action> configureRequest) + { + var descriptor = new RankEvalRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RankEvalResponse, RankEvalRequestParameters>(descriptor); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(CancellationToken cancellationToken = default) + { + var descriptor = new RankEvalRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(RankEvalRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RankEvalRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(RankEvalRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, RankEvalResponse, RankEvalRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to evaluate the quality of ranked search results over a set of typical search queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RankEvalAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RankEvalRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RankEvalResponse, RankEvalRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate(RenderSearchTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate() + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate(RenderSearchTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate(Action configureRequest) + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate(RenderSearchTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RenderSearchTemplateResponse RenderSearchTemplate(Action> configureRequest) + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RenderSearchTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RenderSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScrollResponse Scroll(ScrollRequest request) + { + request.BeforeRequest(); + return DoRequest, ScrollRequestParameters>(request); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScrollAsync(ScrollRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, ScrollRequestParameters>(request, cancellationToken); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScrollResponse Scroll() + { + var descriptor = new ScrollRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, ScrollRequestParameters>(descriptor); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScrollResponse Scroll(ScrollRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ScrollRequestParameters>(descriptor); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScrollResponse Scroll(Action configureRequest) + { + var descriptor = new ScrollRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ScrollRequestParameters>(descriptor); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScrollAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ScrollRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, ScrollRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScrollAsync(ScrollRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ScrollRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to retrieve a large numbers of results from a single search request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScrollAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ScrollRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ScrollRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchResponse Search(SearchRequest request) + { + request.BeforeRequest(); + return DoRequest, SearchRequestParameters>(request); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(SearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, SearchRequestParameters>(request, cancellationToken); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchResponse Search() + { + var descriptor = new SearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchResponse Search(SearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchResponse Search(Action> configureRequest) + { + var descriptor = new SearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SearchRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(SearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns results matching a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SearchRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchTemplateResponse SearchTemplate(SearchTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest, SearchTemplateRequestParameters>(request); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchTemplateAsync(SearchTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, SearchTemplateRequestParameters>(request, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchTemplateResponse SearchTemplate() + { + var descriptor = new SearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchTemplateResponse SearchTemplate(SearchTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchTemplateResponse SearchTemplate(Action> configureRequest) + { + var descriptor = new SearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchTemplateAsync(SearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(TermsEnumRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(TermsEnumRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + var descriptor = new TermsEnumRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest) + { + var descriptor = new TermsEnumRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum() + { + var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(Action> configureRequest) + { + var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + { + var descriptor = new TermsEnumRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// 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. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TermVectorsRequest request) + { + request.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(request); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(request, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TDocument document) + { + var descriptor = new TermVectorsRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TermVectorsResponse TermVectors(TDocument document, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermVectorsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(UpdateByQueryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(UpdateByQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(UpdateByQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Learn more about this API in the Elasticsearch documentation. + ///
+ public virtual Task UpdateByQueryAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateByQueryRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateResponse Update(UpdateRequest request) + { + request.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(request); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(UpdateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(request, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateResponse Update(UpdateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateResponse Update(TDocument document, TPartialDocument partialDocument, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(document, index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateResponse Update(TDocument document, TPartialDocument partialDocument, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(UpdateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, TPartialDocument partialDocument, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, TPartialDocument partialDocument, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs new file mode 100644 index 00000000000..af7295d54f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed class AggregateOrderConverter : SingleOrManyCollectionConverter> +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs new file mode 100644 index 00000000000..ca977c75a2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class AdjacencyMatrixAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs new file mode 100644 index 00000000000..ee8746f028f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs @@ -0,0 +1,317 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class AdjacencyMatrixAggregationConverter : JsonConverter +{ + public override AdjacencyMatrixAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "adjacency_matrix") + throw new JsonException("Unexpected JSON detected."); + var agg = new AdjacencyMatrixAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("filters")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Filters = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, AdjacencyMatrixAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("adjacency_matrix"); + writer.WriteStartObject(); + if (value.Filters is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, value.Filters, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(AdjacencyMatrixAggregationConverter))] +public sealed partial class AdjacencyMatrixAggregation : SearchAggregation +{ + public AdjacencyMatrixAggregation(string name) => Name = name; + + internal AdjacencyMatrixAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Filters used to create buckets.
At least one filter is required.
+ ///
+ public IDictionary? Filters { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class AdjacencyMatrixAggregationDescriptor : SerializableDescriptor> +{ + internal AdjacencyMatrixAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public AdjacencyMatrixAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? FiltersValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Filters used to create buckets.
At least one filter is required.
+ ///
+ public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + { + FiltersValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("adjacency_matrix"); + writer.WriteStartObject(); + if (FiltersValue is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, FiltersValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AdjacencyMatrixAggregationDescriptor : SerializableDescriptor +{ + internal AdjacencyMatrixAggregationDescriptor(Action configure) => configure.Invoke(this); + + public AdjacencyMatrixAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? FiltersValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Filters used to create buckets.
At least one filter is required.
+ ///
+ public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + { + FiltersValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AdjacencyMatrixAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("adjacency_matrix"); + writer.WriteStartObject(); + if (FiltersValue is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, FiltersValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs new file mode 100644 index 00000000000..7eada117285 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(AdjacencyMatrixBucketConverter))] +public sealed partial class AdjacencyMatrixBucket : AggregateDictionary +{ + public AdjacencyMatrixBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } +} + +internal sealed class AdjacencyMatrixBucketConverter : JsonConverter +{ + public override AdjacencyMatrixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new AdjacencyMatrixBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, AdjacencyMatrixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs new file mode 100644 index 00000000000..d16050bfb6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(AggregateDictionaryConverter))] +public partial class AggregateDictionary : IsAReadOnlyDictionary +{ + public AggregateDictionary(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentilesAggregate? GetTDigestPercentiles(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentileRanksAggregate? GetTDigestPercentileRanks(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregate? GetPercentilesBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregate? GetMedianAbsoluteDeviation(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregate? GetMin(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregate? GetMax(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregate? GetSum(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregate? GetAverage(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregate? GetWeightedAverage(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregate? GetValueCount(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregate? GetDerivative(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregate? GetStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregate? GetStatsBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregate? GetExtendedStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregate? GetExtendedStatsBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregate? GetGeoBounds(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregate? GetGeoCentroid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregate? GetHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregate? GetAutoDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregate? GetVariableWidthHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringTermsAggregate? GetStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.LongTermsAggregate? GetLongTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DoubleTermsAggregate? GetDoubleTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringRareTermsAggregate? GetStringRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregate? GetMultiTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregate? GetMissing(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregate? GetNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregate? GetReverseNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregate? GetGlobal(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FilterAggregate? GetFilter(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregate? GetParent(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregate? GetSampler(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregate? GetGeohashGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregate? GetGeotileGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregate? GetGeohexGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregate? GetRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregate? GetDateRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregate? GetGeoDistance(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregate? GetIpRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregate? GetIpPrefix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregate? GetFilters(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregate? GetAdjacencyMatrix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantStringTermsAggregate? GetSignificantStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregate? GetScriptedMetric(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregate? GetTopHits(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregate? GetInference(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregate? GetStringStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregate? GetTopMetrics(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregate? GetTTest(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregate? GetRate(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregate? GetCumulativeCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregate? GetMatrixStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregate? GetGeoLine(string key) => TryGet(key); + private TAggregate TryGet(string key) where TAggregate : class, IAggregate => BackingDictionary.TryGetValue(key, out var agg) ? agg as TAggregate : null; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs new file mode 100644 index 00000000000..fe17da10f7a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs @@ -0,0 +1,1221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(AggregationConverter))] +public sealed partial class Aggregation +{ + internal Aggregation(ISearchAggregation variant) => Variant = variant ?? throw new ArgumentNullException(nameof(variant)); + + internal ISearchAggregation Variant { get; } +} + +internal sealed partial class AggregationConverter : JsonConverter +{ + public override Aggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var readerCopy = reader; + readerCopy.Read(); + if (readerCopy.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException(); + } + + var propertyName = readerCopy.GetString(); + if (propertyName == "adjacency_matrix") + { + return AggregationSerializationHelper.ReadContainer("adjacency_matrix", ref reader, options); + } + + if (propertyName == "auto_date_histogram") + { + return AggregationSerializationHelper.ReadContainer("auto_date_histogram", ref reader, options); + } + + if (propertyName == "avg") + { + return AggregationSerializationHelper.ReadContainer("avg", ref reader, options); + } + + if (propertyName == "boxplot") + { + return AggregationSerializationHelper.ReadContainer("boxplot", ref reader, options); + } + + if (propertyName == "bucket_sort") + { + return AggregationSerializationHelper.ReadContainer("bucket_sort", ref reader, options); + } + + if (propertyName == "cardinality") + { + return AggregationSerializationHelper.ReadContainer("cardinality", ref reader, options); + } + + if (propertyName == "children") + { + return AggregationSerializationHelper.ReadContainer("children", ref reader, options); + } + + if (propertyName == "composite") + { + return AggregationSerializationHelper.ReadContainer("composite", ref reader, options); + } + + if (propertyName == "cumulative_cardinality") + { + return AggregationSerializationHelper.ReadContainer("cumulative_cardinality", ref reader, options); + } + + if (propertyName == "cumulative_sum") + { + return AggregationSerializationHelper.ReadContainer("cumulative_sum", ref reader, options); + } + + if (propertyName == "date_histogram") + { + return AggregationSerializationHelper.ReadContainer("date_histogram", ref reader, options); + } + + if (propertyName == "date_range") + { + return AggregationSerializationHelper.ReadContainer("date_range", ref reader, options); + } + + if (propertyName == "derivative") + { + return AggregationSerializationHelper.ReadContainer("derivative", ref reader, options); + } + + if (propertyName == "diversified_sampler") + { + return AggregationSerializationHelper.ReadContainer("diversified_sampler", ref reader, options); + } + + if (propertyName == "extended_stats") + { + return AggregationSerializationHelper.ReadContainer("extended_stats", ref reader, options); + } + + if (propertyName == "extended_stats_bucket") + { + return AggregationSerializationHelper.ReadContainer("extended_stats_bucket", ref reader, options); + } + + if (propertyName == "filters") + { + return AggregationSerializationHelper.ReadContainer("filters", ref reader, options); + } + + if (propertyName == "geo_bounds") + { + return AggregationSerializationHelper.ReadContainer("geo_bounds", ref reader, options); + } + + if (propertyName == "geo_centroid") + { + return AggregationSerializationHelper.ReadContainer("geo_centroid", ref reader, options); + } + + if (propertyName == "geo_distance") + { + return AggregationSerializationHelper.ReadContainer("geo_distance", ref reader, options); + } + + if (propertyName == "geo_line") + { + return AggregationSerializationHelper.ReadContainer("geo_line", ref reader, options); + } + + if (propertyName == "geohash_grid") + { + return AggregationSerializationHelper.ReadContainer("geohash_grid", ref reader, options); + } + + if (propertyName == "geohex_grid") + { + return AggregationSerializationHelper.ReadContainer("geohex_grid", ref reader, options); + } + + if (propertyName == "geotile_grid") + { + return AggregationSerializationHelper.ReadContainer("geotile_grid", ref reader, options); + } + + if (propertyName == "global") + { + return AggregationSerializationHelper.ReadContainer("global", ref reader, options); + } + + if (propertyName == "histogram") + { + return AggregationSerializationHelper.ReadContainer("histogram", ref reader, options); + } + + if (propertyName == "inference") + { + return AggregationSerializationHelper.ReadContainer("inference", ref reader, options); + } + + if (propertyName == "ip_prefix") + { + return AggregationSerializationHelper.ReadContainer("ip_prefix", ref reader, options); + } + + if (propertyName == "ip_range") + { + return AggregationSerializationHelper.ReadContainer("ip_range", ref reader, options); + } + + if (propertyName == "matrix_stats") + { + return AggregationSerializationHelper.ReadContainer("matrix_stats", ref reader, options); + } + + if (propertyName == "max") + { + return AggregationSerializationHelper.ReadContainer("max", ref reader, options); + } + + if (propertyName == "median_absolute_deviation") + { + return AggregationSerializationHelper.ReadContainer("median_absolute_deviation", ref reader, options); + } + + if (propertyName == "min") + { + return AggregationSerializationHelper.ReadContainer("min", ref reader, options); + } + + if (propertyName == "missing") + { + return AggregationSerializationHelper.ReadContainer("missing", ref reader, options); + } + + if (propertyName == "multi_terms") + { + return AggregationSerializationHelper.ReadContainer("multi_terms", ref reader, options); + } + + if (propertyName == "nested") + { + return AggregationSerializationHelper.ReadContainer("nested", ref reader, options); + } + + if (propertyName == "parent") + { + return AggregationSerializationHelper.ReadContainer("parent", ref reader, options); + } + + if (propertyName == "percentile_ranks") + { + return AggregationSerializationHelper.ReadContainer("percentile_ranks", ref reader, options); + } + + if (propertyName == "percentiles") + { + return AggregationSerializationHelper.ReadContainer("percentiles", ref reader, options); + } + + if (propertyName == "percentiles_bucket") + { + return AggregationSerializationHelper.ReadContainer("percentiles_bucket", ref reader, options); + } + + if (propertyName == "range") + { + return AggregationSerializationHelper.ReadContainer("range", ref reader, options); + } + + if (propertyName == "rare_terms") + { + return AggregationSerializationHelper.ReadContainer("rare_terms", ref reader, options); + } + + if (propertyName == "rate") + { + return AggregationSerializationHelper.ReadContainer("rate", ref reader, options); + } + + if (propertyName == "reverse_nested") + { + return AggregationSerializationHelper.ReadContainer("reverse_nested", ref reader, options); + } + + if (propertyName == "sampler") + { + return AggregationSerializationHelper.ReadContainer("sampler", ref reader, options); + } + + if (propertyName == "scripted_metric") + { + return AggregationSerializationHelper.ReadContainer("scripted_metric", ref reader, options); + } + + if (propertyName == "significant_terms") + { + return AggregationSerializationHelper.ReadContainer("significant_terms", ref reader, options); + } + + if (propertyName == "stats") + { + return AggregationSerializationHelper.ReadContainer("stats", ref reader, options); + } + + if (propertyName == "stats_bucket") + { + return AggregationSerializationHelper.ReadContainer("stats_bucket", ref reader, options); + } + + if (propertyName == "string_stats") + { + return AggregationSerializationHelper.ReadContainer("string_stats", ref reader, options); + } + + if (propertyName == "sum") + { + return AggregationSerializationHelper.ReadContainer("sum", ref reader, options); + } + + if (propertyName == "t_test") + { + return AggregationSerializationHelper.ReadContainer("t_test", ref reader, options); + } + + if (propertyName == "terms") + { + return AggregationSerializationHelper.ReadContainer("terms", ref reader, options); + } + + if (propertyName == "top_hits") + { + return AggregationSerializationHelper.ReadContainer("top_hits", ref reader, options); + } + + if (propertyName == "top_metrics") + { + return AggregationSerializationHelper.ReadContainer("top_metrics", ref reader, options); + } + + if (propertyName == "value_count") + { + return AggregationSerializationHelper.ReadContainer("value_count", ref reader, options); + } + + if (propertyName == "variable_width_histogram") + { + return AggregationSerializationHelper.ReadContainer("variable_width_histogram", ref reader, options); + } + + if (propertyName == "weighted_avg") + { + return AggregationSerializationHelper.ReadContainer("weighted_avg", ref reader, options); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Aggregation value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + } + else if (value.SerializeFluent is not null) + { + value.SerializeFluent(writer, options); + } + else if (value.Variant is not null) + { + var type = value.Variant.GetType(); + JsonSerializer.Serialize(writer, value.Variant, type, options); + } + else + { + throw new JsonException("Invalid container cannot be serialized"); + } + } +} + +public sealed partial class AggregationDescriptor : SerializableDescriptor> +{ + internal AggregationDescriptor(Action> configure) => configure.Invoke(this); + + public AggregationDescriptor() : base() + { + } + + public AggregationDescriptor AdjacencyMatrix(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("adjacency_matrix", configure)); + } + + public AggregationDescriptor AutoDateHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("auto_date_histogram", configure)); + } + + public AggregationDescriptor Avg(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("avg", configure)); + } + + public AggregationDescriptor Boxplot(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("boxplot", configure)); + } + + public AggregationDescriptor BucketSort(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure)); + } + + public AggregationDescriptor Cardinality(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cardinality", configure)); + } + + public AggregationDescriptor Children(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("children", configure)); + } + + public AggregationDescriptor Composite(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("composite", configure)); + } + + public AggregationDescriptor CumulativeCardinality(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cumulative_cardinality", configure)); + } + + public AggregationDescriptor CumulativeSum(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cumulative_sum", configure)); + } + + public AggregationDescriptor DateHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_histogram", configure)); + } + + public AggregationDescriptor DateRange(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_range", configure)); + } + + public AggregationDescriptor Derivative(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("derivative", configure)); + } + + public AggregationDescriptor DiversifiedSampler(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("diversified_sampler", configure)); + } + + public AggregationDescriptor ExtendedStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("extended_stats", configure)); + } + + public AggregationDescriptor ExtendedStatsBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("extended_stats_bucket", configure)); + } + + public AggregationDescriptor Filters(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("filters", configure)); + } + + public AggregationDescriptor GeoBounds(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_bounds", configure)); + } + + public AggregationDescriptor GeoCentroid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_centroid", configure)); + } + + public AggregationDescriptor GeoDistance(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_distance", configure)); + } + + public AggregationDescriptor GeoLine(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_line", configure)); + } + + public AggregationDescriptor GeohashGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohash_grid", configure)); + } + + public AggregationDescriptor GeohexGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohex_grid", configure)); + } + + public AggregationDescriptor GeotileGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geotile_grid", configure)); + } + + public AggregationDescriptor Global(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("global", configure)); + } + + public AggregationDescriptor Histogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("histogram", configure)); + } + + public AggregationDescriptor Inference(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("inference", configure)); + } + + public AggregationDescriptor IpPrefix(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_prefix", configure)); + } + + public AggregationDescriptor IpRange(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_range", configure)); + } + + public AggregationDescriptor MatrixStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("matrix_stats", configure)); + } + + public AggregationDescriptor Max(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("max", configure)); + } + + public AggregationDescriptor MedianAbsoluteDeviation(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("median_absolute_deviation", configure)); + } + + public AggregationDescriptor Min(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("min", configure)); + } + + public AggregationDescriptor Missing(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("missing", configure)); + } + + public AggregationDescriptor MultiTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("multi_terms", configure)); + } + + public AggregationDescriptor Nested(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("nested", configure)); + } + + public AggregationDescriptor Parent(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("parent", configure)); + } + + public AggregationDescriptor PercentileRanks(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure)); + } + + public AggregationDescriptor Percentiles(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure)); + } + + public AggregationDescriptor PercentilesBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentiles_bucket", configure)); + } + + public AggregationDescriptor Range(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("range", configure)); + } + + public AggregationDescriptor RareTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rare_terms", configure)); + } + + public AggregationDescriptor Rate(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rate", configure)); + } + + public AggregationDescriptor ReverseNested(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("reverse_nested", configure)); + } + + public AggregationDescriptor Sampler(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sampler", configure)); + } + + public AggregationDescriptor ScriptedMetric(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("scripted_metric", configure)); + } + + public AggregationDescriptor SignificantTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("significant_terms", configure)); + } + + public AggregationDescriptor Stats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("stats", configure)); + } + + public AggregationDescriptor StatsBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("stats_bucket", configure)); + } + + public AggregationDescriptor StringStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("string_stats", configure)); + } + + public AggregationDescriptor Sum(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sum", configure)); + } + + public AggregationDescriptor TTest(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("t_test", configure)); + } + + public AggregationDescriptor Terms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("terms", configure)); + } + + public AggregationDescriptor TopHits(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_hits", configure)); + } + + public AggregationDescriptor TopMetrics(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_metrics", configure)); + } + + public AggregationDescriptor ValueCount(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("value_count", configure)); + } + + public AggregationDescriptor VariableWidthHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("variable_width_histogram", configure)); + } + + public AggregationDescriptor WeightedAvg(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("weighted_avg", configure)); + } +} + +public sealed partial class AggregationDescriptor : SerializableDescriptor +{ + internal AggregationDescriptor(Action configure) => configure.Invoke(this); + + public AggregationDescriptor() : base() + { + } + + public AggregationDescriptor AdjacencyMatrix(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("adjacency_matrix", configure)); + } + + public AggregationDescriptor AdjacencyMatrix(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("adjacency_matrix", configure)); + } + + public AggregationDescriptor AutoDateHistogram(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("auto_date_histogram", configure)); + } + + public AggregationDescriptor AutoDateHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("auto_date_histogram", configure)); + } + + public AggregationDescriptor Avg(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("avg", configure)); + } + + public AggregationDescriptor Avg(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("avg", configure)); + } + + public AggregationDescriptor Boxplot(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("boxplot", configure)); + } + + public AggregationDescriptor Boxplot(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("boxplot", configure)); + } + + public AggregationDescriptor BucketSort(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure)); + } + + public AggregationDescriptor BucketSort(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure)); + } + + public AggregationDescriptor Cardinality(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cardinality", configure)); + } + + public AggregationDescriptor Cardinality(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cardinality", configure)); + } + + public AggregationDescriptor Children(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("children", configure)); + } + + public AggregationDescriptor Children(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("children", configure)); + } + + public AggregationDescriptor Composite(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("composite", configure)); + } + + public AggregationDescriptor Composite(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("composite", configure)); + } + + public AggregationDescriptor CumulativeCardinality(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cumulative_cardinality", configure)); + } + + public AggregationDescriptor CumulativeSum(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("cumulative_sum", configure)); + } + + public AggregationDescriptor DateHistogram(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_histogram", configure)); + } + + public AggregationDescriptor DateHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_histogram", configure)); + } + + public AggregationDescriptor DateRange(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_range", configure)); + } + + public AggregationDescriptor DateRange(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("date_range", configure)); + } + + public AggregationDescriptor Derivative(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("derivative", configure)); + } + + public AggregationDescriptor DiversifiedSampler(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("diversified_sampler", configure)); + } + + public AggregationDescriptor DiversifiedSampler(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("diversified_sampler", configure)); + } + + public AggregationDescriptor ExtendedStats(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("extended_stats", configure)); + } + + public AggregationDescriptor ExtendedStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("extended_stats", configure)); + } + + public AggregationDescriptor ExtendedStatsBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("extended_stats_bucket", configure)); + } + + public AggregationDescriptor Filters(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("filters", configure)); + } + + public AggregationDescriptor Filters(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("filters", configure)); + } + + public AggregationDescriptor GeoBounds(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_bounds", configure)); + } + + public AggregationDescriptor GeoBounds(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_bounds", configure)); + } + + public AggregationDescriptor GeoCentroid(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_centroid", configure)); + } + + public AggregationDescriptor GeoCentroid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_centroid", configure)); + } + + public AggregationDescriptor GeoDistance(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_distance", configure)); + } + + public AggregationDescriptor GeoDistance(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_distance", configure)); + } + + public AggregationDescriptor GeoLine(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_line", configure)); + } + + public AggregationDescriptor GeoLine(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geo_line", configure)); + } + + public AggregationDescriptor GeohashGrid(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohash_grid", configure)); + } + + public AggregationDescriptor GeohashGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohash_grid", configure)); + } + + public AggregationDescriptor GeohexGrid(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohex_grid", configure)); + } + + public AggregationDescriptor GeohexGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geohex_grid", configure)); + } + + public AggregationDescriptor GeotileGrid(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geotile_grid", configure)); + } + + public AggregationDescriptor GeotileGrid(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("geotile_grid", configure)); + } + + public AggregationDescriptor Global(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("global", configure)); + } + + public AggregationDescriptor Global(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("global", configure)); + } + + public AggregationDescriptor Histogram(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("histogram", configure)); + } + + public AggregationDescriptor Histogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("histogram", configure)); + } + + public AggregationDescriptor Inference(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("inference", configure)); + } + + public AggregationDescriptor Inference(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("inference", configure)); + } + + public AggregationDescriptor IpPrefix(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_prefix", configure)); + } + + public AggregationDescriptor IpPrefix(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_prefix", configure)); + } + + public AggregationDescriptor IpRange(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_range", configure)); + } + + public AggregationDescriptor IpRange(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("ip_range", configure)); + } + + public AggregationDescriptor MatrixStats(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("matrix_stats", configure)); + } + + public AggregationDescriptor MatrixStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("matrix_stats", configure)); + } + + public AggregationDescriptor Max(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("max", configure)); + } + + public AggregationDescriptor Max(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("max", configure)); + } + + public AggregationDescriptor MedianAbsoluteDeviation(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("median_absolute_deviation", configure)); + } + + public AggregationDescriptor MedianAbsoluteDeviation(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("median_absolute_deviation", configure)); + } + + public AggregationDescriptor Min(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("min", configure)); + } + + public AggregationDescriptor Min(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("min", configure)); + } + + public AggregationDescriptor Missing(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("missing", configure)); + } + + public AggregationDescriptor Missing(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("missing", configure)); + } + + public AggregationDescriptor MultiTerms(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("multi_terms", configure)); + } + + public AggregationDescriptor MultiTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("multi_terms", configure)); + } + + public AggregationDescriptor Nested(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("nested", configure)); + } + + public AggregationDescriptor Nested(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("nested", configure)); + } + + public AggregationDescriptor Parent(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("parent", configure)); + } + + public AggregationDescriptor Parent(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("parent", configure)); + } + + public AggregationDescriptor PercentileRanks(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure)); + } + + public AggregationDescriptor PercentileRanks(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure)); + } + + public AggregationDescriptor Percentiles(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure)); + } + + public AggregationDescriptor Percentiles(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure)); + } + + public AggregationDescriptor PercentilesBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("percentiles_bucket", configure)); + } + + public AggregationDescriptor Range(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("range", configure)); + } + + public AggregationDescriptor Range(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("range", configure)); + } + + public AggregationDescriptor RareTerms(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rare_terms", configure)); + } + + public AggregationDescriptor RareTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rare_terms", configure)); + } + + public AggregationDescriptor Rate(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rate", configure)); + } + + public AggregationDescriptor Rate(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("rate", configure)); + } + + public AggregationDescriptor ReverseNested(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("reverse_nested", configure)); + } + + public AggregationDescriptor ReverseNested(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("reverse_nested", configure)); + } + + public AggregationDescriptor Sampler(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sampler", configure)); + } + + public AggregationDescriptor Sampler(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sampler", configure)); + } + + public AggregationDescriptor ScriptedMetric(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("scripted_metric", configure)); + } + + public AggregationDescriptor ScriptedMetric(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("scripted_metric", configure)); + } + + public AggregationDescriptor SignificantTerms(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("significant_terms", configure)); + } + + public AggregationDescriptor SignificantTerms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("significant_terms", configure)); + } + + public AggregationDescriptor Stats(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("stats", configure)); + } + + public AggregationDescriptor Stats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("stats", configure)); + } + + public AggregationDescriptor StatsBucket(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("stats_bucket", configure)); + } + + public AggregationDescriptor StringStats(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("string_stats", configure)); + } + + public AggregationDescriptor StringStats(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("string_stats", configure)); + } + + public AggregationDescriptor Sum(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sum", configure)); + } + + public AggregationDescriptor Sum(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("sum", configure)); + } + + public AggregationDescriptor TTest(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("t_test", configure)); + } + + public AggregationDescriptor TTest(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("t_test", configure)); + } + + public AggregationDescriptor Terms(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("terms", configure)); + } + + public AggregationDescriptor Terms(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("terms", configure)); + } + + public AggregationDescriptor TopHits(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_hits", configure)); + } + + public AggregationDescriptor TopHits(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_hits", configure)); + } + + public AggregationDescriptor TopMetrics(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_metrics", configure)); + } + + public AggregationDescriptor TopMetrics(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("top_metrics", configure)); + } + + public AggregationDescriptor ValueCount(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("value_count", configure)); + } + + public AggregationDescriptor ValueCount(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("value_count", configure)); + } + + public AggregationDescriptor VariableWidthHistogram(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("variable_width_histogram", configure)); + } + + public AggregationDescriptor VariableWidthHistogram(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("variable_width_histogram", configure)); + } + + public AggregationDescriptor WeightedAvg(string name, Action configure) + { + return SetContainer(name, Aggregation.CreateWithAction("weighted_avg", configure)); + } + + public AggregationDescriptor WeightedAvg(string name, Action> configure) + { + return SetContainer(name, Aggregation.CreateWithAction("weighted_avg", configure)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregationRange.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregationRange.g.cs new file mode 100644 index 00000000000..f58364f948a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregationRange.g.cs @@ -0,0 +1,113 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class AggregationRange +{ + /// + /// Start of the range (inclusive). + /// + [JsonInclude, JsonPropertyName("from")] + public object? From { get; set; } + + /// + /// Custom key to return the range with. + /// + [JsonInclude, JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// End of the range (exclusive). + /// + [JsonInclude, JsonPropertyName("to")] + public object? To { get; set; } +} + +public sealed partial class AggregationRangeDescriptor : SerializableDescriptor +{ + internal AggregationRangeDescriptor(Action configure) => configure.Invoke(this); + + public AggregationRangeDescriptor() : base() + { + } + + private object? FromValue { get; set; } + private string? KeyValue { get; set; } + private object? ToValue { get; set; } + + /// + /// Start of the range (inclusive). + /// + public AggregationRangeDescriptor From(object? from) + { + FromValue = from; + return Self; + } + + /// + /// Custom key to return the range with. + /// + public AggregationRangeDescriptor Key(string? key) + { + KeyValue = key; + return Self; + } + + /// + /// End of the range (exclusive). + /// + public AggregationRangeDescriptor To(object? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (!string.IsNullOrEmpty(KeyValue)) + { + writer.WritePropertyName("key"); + writer.WriteStringValue(KeyValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ArrayPercentilesItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ArrayPercentilesItem.g.cs new file mode 100644 index 00000000000..b6a82927a11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ArrayPercentilesItem.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ArrayPercentilesItem +{ + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs new file mode 100644 index 00000000000..7e74900acda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class AutoDateHistogramAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("interval")] + public string Interval { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs new file mode 100644 index 00000000000..be0d5d866c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs @@ -0,0 +1,764 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class AutoDateHistogramAggregationConverter : JsonConverter +{ + public override AutoDateHistogramAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "auto_date_histogram") + throw new JsonException("Unexpected JSON detected."); + var agg = new AutoDateHistogramAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Buckets = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("minimum_interval")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinimumInterval = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("offset")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Offset = value; + } + + continue; + } + + if (reader.ValueTextEquals("params")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Params = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("time_zone")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TimeZone = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, AutoDateHistogramAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("auto_date_histogram"); + writer.WriteStartObject(); + if (value.Buckets.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(value.Buckets.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.MinimumInterval is not null) + { + writer.WritePropertyName("minimum_interval"); + JsonSerializer.Serialize(writer, value.MinimumInterval, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (!string.IsNullOrEmpty(value.Offset)) + { + writer.WritePropertyName("offset"); + writer.WriteStringValue(value.Offset); + } + + if (value.Params is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, value.Params, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.TimeZone is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, value.TimeZone, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(AutoDateHistogramAggregationConverter))] +public sealed partial class AutoDateHistogramAggregation : SearchAggregation +{ + public AutoDateHistogramAggregation(string name) => Name = name; + + internal AutoDateHistogramAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The target number of buckets. + /// + public int? Buckets { get; set; } + + /// + /// The field on which to run the aggregation. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public string? Format { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The minimum rounding interval.
This can make the collection process more efficient, as the aggregation will not attempt to round at any interval lower than `minimum_interval`.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinimumInterval? MinimumInterval { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateTimeOffset? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// Time zone specified as a ISO 8601 UTC offset. + /// + public string? Offset { get; set; } + public IDictionary? Params { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Time zone ID. + /// + public string? TimeZone { get; set; } +} + +public sealed partial class AutoDateHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal AutoDateHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public AutoDateHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private int? BucketsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinimumInterval? MinimumIntervalValue { get; set; } + private DateTimeOffset? MissingValue { get; set; } + private string? OffsetValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + + public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The target number of buckets. + /// + public AutoDateHistogramAggregationDescriptor Buckets(int? buckets) + { + BucketsValue = buckets; + return Self; + } + + /// + /// The field on which to run the aggregation. + /// + public AutoDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field on which to run the aggregation. + /// + public AutoDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public AutoDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum rounding interval.
This can make the collection process more efficient, as the aggregation will not attempt to round at any interval lower than `minimum_interval`.
+ ///
+ public AutoDateHistogramAggregationDescriptor MinimumInterval(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinimumInterval? minimumInterval) + { + MinimumIntervalValue = minimumInterval; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Time zone specified as a ISO 8601 UTC offset. + /// + public AutoDateHistogramAggregationDescriptor Offset(string? offset) + { + OffsetValue = offset; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AutoDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Time zone ID. + /// + public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("auto_date_histogram"); + writer.WriteStartObject(); + if (BucketsValue.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(BucketsValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MinimumIntervalValue is not null) + { + writer.WritePropertyName("minimum_interval"); + JsonSerializer.Serialize(writer, MinimumIntervalValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (!string.IsNullOrEmpty(OffsetValue)) + { + writer.WritePropertyName("offset"); + writer.WriteStringValue(OffsetValue); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AutoDateHistogramAggregationDescriptor : SerializableDescriptor +{ + internal AutoDateHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public AutoDateHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private int? BucketsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinimumInterval? MinimumIntervalValue { get; set; } + private DateTimeOffset? MissingValue { get; set; } + private string? OffsetValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + + public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The target number of buckets. + /// + public AutoDateHistogramAggregationDescriptor Buckets(int? buckets) + { + BucketsValue = buckets; + return Self; + } + + /// + /// The field on which to run the aggregation. + /// + public AutoDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field on which to run the aggregation. + /// + public AutoDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field on which to run the aggregation. + /// + public AutoDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public AutoDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum rounding interval.
This can make the collection process more efficient, as the aggregation will not attempt to round at any interval lower than `minimum_interval`.
+ ///
+ public AutoDateHistogramAggregationDescriptor MinimumInterval(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinimumInterval? minimumInterval) + { + MinimumIntervalValue = minimumInterval; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Time zone specified as a ISO 8601 UTC offset. + /// + public AutoDateHistogramAggregationDescriptor Offset(string? offset) + { + OffsetValue = offset; + return Self; + } + + public AutoDateHistogramAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AutoDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Time zone ID. + /// + public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("auto_date_histogram"); + writer.WriteStartObject(); + if (BucketsValue.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(BucketsValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MinimumIntervalValue is not null) + { + writer.WritePropertyName("minimum_interval"); + JsonSerializer.Serialize(writer, MinimumIntervalValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (!string.IsNullOrEmpty(OffsetValue)) + { + writer.WritePropertyName("offset"); + writer.WriteStringValue(OffsetValue); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs new file mode 100644 index 00000000000..8690cc18f39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class AverageAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs new file mode 100644 index 00000000000..dc91541cdde --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class AverageAggregationConverter : JsonConverter +{ + public override AverageAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "avg") + throw new JsonException("Unexpected JSON detected."); + var agg = new AverageAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, AverageAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("avg"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(AverageAggregationConverter))] +public sealed partial class AverageAggregation : SearchAggregation +{ + public AverageAggregation(string name, Field field) : this(name) => Field = field; + public AverageAggregation(string name) => Name = name; + + internal AverageAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class AverageAggregationDescriptor : SerializableDescriptor> +{ + internal AverageAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public AverageAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public AverageAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AverageAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AverageAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("avg"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AverageAggregationDescriptor : SerializableDescriptor +{ + internal AverageAggregationDescriptor(Action configure) => configure.Invoke(this); + + public AverageAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public AverageAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AverageAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AverageAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AverageAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("avg"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregate.g.cs new file mode 100644 index 00000000000..2be67ea4c19 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregate.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class BoxplotAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("lower")] + public double Lower { get; init; } + [JsonInclude, JsonPropertyName("lower_as_string")] + public string? LowerAsString { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } + [JsonInclude, JsonPropertyName("q1")] + public double Q1 { get; init; } + [JsonInclude, JsonPropertyName("q1_as_string")] + public string? Q1AsString { get; init; } + [JsonInclude, JsonPropertyName("q2")] + public double Q2 { get; init; } + [JsonInclude, JsonPropertyName("q2_as_string")] + public string? Q2AsString { get; init; } + [JsonInclude, JsonPropertyName("q3")] + public double Q3 { get; init; } + [JsonInclude, JsonPropertyName("q3_as_string")] + public string? Q3AsString { get; init; } + [JsonInclude, JsonPropertyName("upper")] + public double Upper { get; init; } + [JsonInclude, JsonPropertyName("upper_as_string")] + public string? UpperAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs new file mode 100644 index 00000000000..589c1f74739 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs @@ -0,0 +1,366 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class BoxplotAggregationConverter : JsonConverter +{ + public override BoxplotAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "boxplot") + throw new JsonException("Unexpected JSON detected."); + var agg = new BoxplotAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("compression")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Compression = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, BoxplotAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("boxplot"); + writer.WriteStartObject(); + if (value.Compression.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(value.Compression.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(BoxplotAggregationConverter))] +public sealed partial class BoxplotAggregation : SearchAggregation +{ + public BoxplotAggregation(string name, Field field) : this(name) => Field = field; + public BoxplotAggregation(string name) => Name = name; + + internal BoxplotAggregation() + { + } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public double? Compression { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class BoxplotAggregationDescriptor : SerializableDescriptor> +{ + internal BoxplotAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public BoxplotAggregationDescriptor() : base() + { + } + + private double? CompressionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public BoxplotAggregationDescriptor Compression(double? compression) + { + CompressionValue = compression; + return Self; + } + + public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public BoxplotAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public BoxplotAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BoxplotAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("boxplot"); + writer.WriteStartObject(); + if (CompressionValue.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(CompressionValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class BoxplotAggregationDescriptor : SerializableDescriptor +{ + internal BoxplotAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BoxplotAggregationDescriptor() : base() + { + } + + private double? CompressionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public BoxplotAggregationDescriptor Compression(double? compression) + { + CompressionValue = compression; + return Self; + } + + public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public BoxplotAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public BoxplotAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public BoxplotAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BoxplotAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("boxplot"); + writer.WriteStartObject(); + if (CompressionValue.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(CompressionValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs new file mode 100644 index 00000000000..eb8d28bf489 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs @@ -0,0 +1,489 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class BucketSortAggregationConverter : JsonConverter +{ + public override BucketSortAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "bucket_sort") + throw new JsonException("Unexpected JSON detected."); + var agg = new BucketSortAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("from")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.From = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("sort")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize(ref reader, options); + if (value is not null) + { + agg.Sort = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, BucketSortAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("bucket_sort"); + writer.WriteStartObject(); + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(value.Sort, writer, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(BucketSortAggregationConverter))] +public sealed partial class BucketSortAggregation : SearchAggregation +{ + public BucketSortAggregation(string name) => Name = name; + + internal BucketSortAggregation() + { + } + + /// + /// Buckets in positions prior to `from` will be truncated. + /// + public int? From { get; set; } + + /// + /// The policy to apply when gaps are found in the data. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
+ ///
+ public int? Size { get; set; } + + /// + /// The list of fields to sort on. + /// + public ICollection? Sort { get; set; } +} + +public sealed partial class BucketSortAggregationDescriptor : SerializableDescriptor> +{ + internal BucketSortAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public BucketSortAggregationDescriptor() : base() + { + } + + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private int? FromValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The list of fields to sort on. + /// + public BucketSortAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public BucketSortAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public BucketSortAggregationDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public BucketSortAggregationDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Buckets in positions prior to `from` will be truncated. + /// + public BucketSortAggregationDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// The policy to apply when gaps are found in the data. + /// + public BucketSortAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketSortAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
+ ///
+ public BucketSortAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bucket_sort"); + writer.WriteStartObject(); + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class BucketSortAggregationDescriptor : SerializableDescriptor +{ + internal BucketSortAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketSortAggregationDescriptor() : base() + { + } + + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private int? FromValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The list of fields to sort on. + /// + public BucketSortAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public BucketSortAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public BucketSortAggregationDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public BucketSortAggregationDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Buckets in positions prior to `from` will be truncated. + /// + public BucketSortAggregationDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// The policy to apply when gaps are found in the data. + /// + public BucketSortAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketSortAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
+ ///
+ public BucketSortAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bucket_sort"); + writer.WriteStartObject(); + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs new file mode 100644 index 00000000000..de77d4de89f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class Buckets : Union, IReadOnlyCollection> +{ + public Buckets(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public Buckets(IReadOnlyCollection collection) : base(collection) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs new file mode 100644 index 00000000000..bb634fe719b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Buckets path can be expressed in different ways, and an aggregation may accept some or all of these
forms depending on its type. Please refer to each aggregation's documentation to know what buckets
path forms they accept.
+///
+[JsonConverter(typeof(BucketsPathConverter))] +public sealed partial class BucketsPath : IComplexUnion +{ + public enum Kind + { + Single, + Array, + Dictionary + } + + private readonly Kind _kind; + private readonly object _value; + + Kind IComplexUnion.ValueKind => _kind; + + object IComplexUnion.Value => _value; + + private BucketsPath(Kind kind, object value) + { + _kind = kind; + _value = value; + } + + public static BucketsPath Single(string single) => new(Kind.Single, single); + + public bool IsSingle => _kind == Kind.Single; + + public bool TryGetSingle([NotNullWhen(true)] out string? single) + { + single = null; + if (_kind == Kind.Single) + { + single = (string)_value; + return true; + } + + return false; + } + + public static implicit operator BucketsPath(string single) => BucketsPath.Single(single); + + public static BucketsPath Array(string[] array) => new(Kind.Array, array); + + public bool IsArray => _kind == Kind.Array; + + public bool TryGetArray([NotNullWhen(true)] out string[]? array) + { + array = null; + if (_kind == Kind.Array) + { + array = (string[])_value; + return true; + } + + return false; + } + + public static implicit operator BucketsPath(string[] array) => BucketsPath.Array(array); + + public static BucketsPath Dictionary(Dictionary dictionary) => new(Kind.Dictionary, dictionary); + + public bool IsDictionary => _kind == Kind.Dictionary; + + public bool TryGetDictionary([NotNullWhen(true)] out Dictionary? dictionary) + { + dictionary = null; + if (_kind == Kind.Dictionary) + { + dictionary = (Dictionary)_value; + return true; + } + + return false; + } + + public static implicit operator BucketsPath(Dictionary dictionary) => BucketsPath.Dictionary(dictionary); +} + +internal sealed class BucketsPathConverter : MultiItemUnionConverter +{ + public BucketsPathConverter() + { + _arrayType = typeof(string[]); + _types = new Dictionary { { BucketsPath.Kind.Single, typeof(string) }, { BucketsPath.Kind.Array, typeof(string[]) }, { BucketsPath.Kind.Dictionary, typeof(Dictionary) } }; + _factories = new Dictionary> { { typeof(string), o => BucketsPath.Single((string)o) }, { typeof(string[]), o => BucketsPath.Array((string[])o) }, { typeof(Dictionary), o => BucketsPath.Dictionary((Dictionary)o) } }; + _uniquePropertyToType = new Dictionary { }; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregate.g.cs new file mode 100644 index 00000000000..f6c9cc9a95a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class CardinalityAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public long Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs new file mode 100644 index 00000000000..c272b9eab27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs @@ -0,0 +1,466 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class CardinalityAggregationConverter : JsonConverter +{ + public override CardinalityAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "cardinality") + throw new JsonException("Unexpected JSON detected."); + var agg = new CardinalityAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("execution_hint")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ExecutionHint = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("precision_threshold")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.PrecisionThreshold = value; + } + + continue; + } + + if (reader.ValueTextEquals("rehash")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Rehash = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, CardinalityAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("cardinality"); + writer.WriteStartObject(); + if (value.ExecutionHint is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, value.ExecutionHint, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.PrecisionThreshold.HasValue) + { + writer.WritePropertyName("precision_threshold"); + writer.WriteNumberValue(value.PrecisionThreshold.Value); + } + + if (value.Rehash.HasValue) + { + writer.WritePropertyName("rehash"); + writer.WriteBooleanValue(value.Rehash.Value); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(CardinalityAggregationConverter))] +public sealed partial class CardinalityAggregation : SearchAggregation +{ + public CardinalityAggregation(string name, Field field) : this(name) => Field = field; + public CardinalityAggregation(string name) => Name = name; + + internal CardinalityAggregation() + { + } + + /// + /// Mechanism by which cardinality aggregations is run. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? ExecutionHint { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// A unique count below which counts are expected to be close to accurate.
This allows to trade memory for accuracy.
+ ///
+ public int? PrecisionThreshold { get; set; } + public bool? Rehash { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class CardinalityAggregationDescriptor : SerializableDescriptor> +{ + internal CardinalityAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CardinalityAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private int? PrecisionThresholdValue { get; set; } + private bool? RehashValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Mechanism by which cardinality aggregations is run. + /// + public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public CardinalityAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CardinalityAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CardinalityAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// A unique count below which counts are expected to be close to accurate.
This allows to trade memory for accuracy.
+ ///
+ public CardinalityAggregationDescriptor PrecisionThreshold(int? precisionThreshold) + { + PrecisionThresholdValue = precisionThreshold; + return Self; + } + + public CardinalityAggregationDescriptor Rehash(bool? rehash = true) + { + RehashValue = rehash; + return Self; + } + + public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cardinality"); + writer.WriteStartObject(); + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PrecisionThresholdValue.HasValue) + { + writer.WritePropertyName("precision_threshold"); + writer.WriteNumberValue(PrecisionThresholdValue.Value); + } + + if (RehashValue.HasValue) + { + writer.WritePropertyName("rehash"); + writer.WriteBooleanValue(RehashValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CardinalityAggregationDescriptor : SerializableDescriptor +{ + internal CardinalityAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CardinalityAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private int? PrecisionThresholdValue { get; set; } + private bool? RehashValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Mechanism by which cardinality aggregations is run. + /// + public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public CardinalityAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CardinalityAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CardinalityAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CardinalityAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// A unique count below which counts are expected to be close to accurate.
This allows to trade memory for accuracy.
+ ///
+ public CardinalityAggregationDescriptor PrecisionThreshold(int? precisionThreshold) + { + PrecisionThresholdValue = precisionThreshold; + return Self; + } + + public CardinalityAggregationDescriptor Rehash(bool? rehash = true) + { + RehashValue = rehash; + return Self; + } + + public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cardinality"); + writer.WriteStartObject(); + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PrecisionThresholdValue.HasValue) + { + writer.WritePropertyName("precision_threshold"); + writer.WriteNumberValue(PrecisionThresholdValue.Value); + } + + if (RehashValue.HasValue) + { + writer.WritePropertyName("rehash"); + writer.WriteBooleanValue(RehashValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs new file mode 100644 index 00000000000..55c0bada3fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ChiSquareHeuristic +{ + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + [JsonInclude, JsonPropertyName("background_is_superset")] + public bool BackgroundIsSuperset { get; set; } + + /// + /// Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. + /// + [JsonInclude, JsonPropertyName("include_negatives")] + public bool IncludeNegatives { get; set; } +} + +public sealed partial class ChiSquareHeuristicDescriptor : SerializableDescriptor +{ + internal ChiSquareHeuristicDescriptor(Action configure) => configure.Invoke(this); + + public ChiSquareHeuristicDescriptor() : base() + { + } + + private bool BackgroundIsSupersetValue { get; set; } + private bool IncludeNegativesValue { get; set; } + + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + public ChiSquareHeuristicDescriptor BackgroundIsSuperset(bool backgroundIsSuperset = true) + { + BackgroundIsSupersetValue = backgroundIsSuperset; + return Self; + } + + /// + /// Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. + /// + public ChiSquareHeuristicDescriptor IncludeNegatives(bool includeNegatives = true) + { + IncludeNegativesValue = includeNegatives; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("background_is_superset"); + writer.WriteBooleanValue(BackgroundIsSupersetValue); + writer.WritePropertyName("include_negatives"); + writer.WriteBooleanValue(IncludeNegativesValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs new file mode 100644 index 00000000000..32817a6d323 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(ChildrenAggregateConverter))] +public sealed partial class ChildrenAggregate : AggregateDictionary, IAggregate +{ + public ChildrenAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class ChildrenAggregateConverter : JsonConverter +{ + public override ChildrenAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new ChildrenAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, ChildrenAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs new file mode 100644 index 00000000000..7a3fe65e883 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs @@ -0,0 +1,317 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ChildrenAggregationConverter : JsonConverter +{ + public override ChildrenAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "children") + throw new JsonException("Unexpected JSON detected."); + var agg = new ChildrenAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Type = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ChildrenAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("children"); + writer.WriteStartObject(); + if (value.Type is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, value.Type, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ChildrenAggregationConverter))] +public sealed partial class ChildrenAggregation : SearchAggregation +{ + public ChildrenAggregation(string name) => Name = name; + + internal ChildrenAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The child type that should be selected. + /// + public string? Type { get; set; } +} + +public sealed partial class ChildrenAggregationDescriptor : SerializableDescriptor> +{ + internal ChildrenAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ChildrenAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private string? TypeValue { get; set; } + + public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ChildrenAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The child type that should be selected. + /// + public ChildrenAggregationDescriptor Type(string? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("children"); + writer.WriteStartObject(); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ChildrenAggregationDescriptor : SerializableDescriptor +{ + internal ChildrenAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ChildrenAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private string? TypeValue { get; set; } + + public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ChildrenAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The child type that should be selected. + /// + public ChildrenAggregationDescriptor Type(string? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("children"); + writer.WriteStartObject(); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs new file mode 100644 index 00000000000..e9f715ab428 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class CompositeAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("after_key")] + public IReadOnlyDictionary? AfterKey { get; init; } + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs new file mode 100644 index 00000000000..e9c94abf8c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs @@ -0,0 +1,426 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class CompositeAggregationConverter : JsonConverter +{ + public override CompositeAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "composite") + throw new JsonException("Unexpected JSON detected."); + var agg = new CompositeAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("after")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.After = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("sources")) + { + reader.Read(); + var value = JsonSerializer.Deserialize>?>(ref reader, options); + if (value is not null) + { + agg.Sources = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, CompositeAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("composite"); + writer.WriteStartObject(); + if (value.After is not null) + { + writer.WritePropertyName("after"); + JsonSerializer.Serialize(writer, value.After, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sources is not null) + { + writer.WritePropertyName("sources"); + JsonSerializer.Serialize(writer, value.Sources, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(CompositeAggregationConverter))] +public sealed partial class CompositeAggregation : SearchAggregation +{ + public CompositeAggregation(string name) => Name = name; + + internal CompositeAggregation() + { + } + + /// + /// When paginating, use the `after_key` value returned in the previous response to retrieve the next page. + /// + public IDictionary? After { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The number of composite buckets that should be returned. + /// + public int? Size { get; set; } + + /// + /// The value sources used to build composite buckets.
Keys are returned in the order of the `sources` definition.
+ ///
+ public ICollection>? Sources { get; set; } +} + +public sealed partial class CompositeAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? AfterValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + private ICollection>? SourcesValue { get; set; } + + public CompositeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public CompositeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// When paginating, use the `after_key` value returned in the previous response to retrieve the next page. + /// + public CompositeAggregationDescriptor After(Func, FluentDictionary> selector) + { + AfterValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of composite buckets that should be returned. + /// + public CompositeAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The value sources used to build composite buckets.
Keys are returned in the order of the `sources` definition.
+ ///
+ public CompositeAggregationDescriptor Sources(ICollection>? sources) + { + SourcesValue = sources; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("composite"); + writer.WriteStartObject(); + if (AfterValue is not null) + { + writer.WritePropertyName("after"); + JsonSerializer.Serialize(writer, AfterValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SourcesValue is not null) + { + writer.WritePropertyName("sources"); + JsonSerializer.Serialize(writer, SourcesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeAggregationDescriptor : SerializableDescriptor +{ + internal CompositeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? AfterValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + private ICollection>? SourcesValue { get; set; } + + public CompositeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public CompositeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// When paginating, use the `after_key` value returned in the previous response to retrieve the next page. + /// + public CompositeAggregationDescriptor After(Func, FluentDictionary> selector) + { + AfterValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of composite buckets that should be returned. + /// + public CompositeAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The value sources used to build composite buckets.
Keys are returned in the order of the `sources` definition.
+ ///
+ public CompositeAggregationDescriptor Sources(ICollection>? sources) + { + SourcesValue = sources; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("composite"); + writer.WriteStartObject(); + if (AfterValue is not null) + { + writer.WritePropertyName("after"); + JsonSerializer.Serialize(writer, AfterValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SourcesValue is not null) + { + writer.WritePropertyName("sources"); + JsonSerializer.Serialize(writer, SourcesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs new file mode 100644 index 00000000000..bdb922f09a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class CompositeAggregationSource +{ +} + +public sealed partial class CompositeAggregationSourceDescriptor : SerializableDescriptor +{ + internal CompositeAggregationSourceDescriptor(Action configure) => configure.Invoke(this); + + public CompositeAggregationSourceDescriptor() : base() + { + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs new file mode 100644 index 00000000000..7933028dd64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(CompositeBucketConverter))] +public sealed partial class CompositeBucket : AggregateDictionary +{ + public CompositeBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public IReadOnlyDictionary Key { get; init; } +} + +internal sealed class CompositeBucketConverter : JsonConverter +{ + public override CompositeBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new CompositeBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, CompositeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs new file mode 100644 index 00000000000..cff07a06f50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of the `cumulative_cardinality` aggregation +/// +public sealed partial class CumulativeCardinalityAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public long Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs new file mode 100644 index 00000000000..0330233888a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class CumulativeCardinalityAggregationConverter : JsonConverter +{ + public override CumulativeCardinalityAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "cumulative_cardinality") + throw new JsonException("Unexpected JSON detected."); + var agg = new CumulativeCardinalityAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, CumulativeCardinalityAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("cumulative_cardinality"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(CumulativeCardinalityAggregationConverter))] +public sealed partial class CumulativeCardinalityAggregation : SearchAggregation +{ + public CumulativeCardinalityAggregation(string name) => Name = name; + + internal CumulativeCardinalityAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class CumulativeCardinalityAggregationDescriptor : SerializableDescriptor +{ + internal CumulativeCardinalityAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CumulativeCardinalityAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public CumulativeCardinalityAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public CumulativeCardinalityAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CumulativeCardinalityAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public CumulativeCardinalityAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cumulative_cardinality"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs new file mode 100644 index 00000000000..e399dccee59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class CumulativeSumAggregationConverter : JsonConverter +{ + public override CumulativeSumAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "cumulative_sum") + throw new JsonException("Unexpected JSON detected."); + var agg = new CumulativeSumAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, CumulativeSumAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("cumulative_sum"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(CumulativeSumAggregationConverter))] +public sealed partial class CumulativeSumAggregation : SearchAggregation +{ + public CumulativeSumAggregation(string name) => Name = name; + + internal CumulativeSumAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class CumulativeSumAggregationDescriptor : SerializableDescriptor +{ + internal CumulativeSumAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CumulativeSumAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public CumulativeSumAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public CumulativeSumAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CumulativeSumAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public CumulativeSumAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cumulative_sum"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs new file mode 100644 index 00000000000..6a9e78363d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class DateHistogramAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs new file mode 100644 index 00000000000..e69cfff8946 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs @@ -0,0 +1,874 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class DateHistogramAggregationConverter : JsonConverter +{ + public override DateHistogramAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "date_histogram") + throw new JsonException("Unexpected JSON detected."); + var agg = new DateHistogramAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("calendar_interval")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.CalendarInterval = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("fixed_interval")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.FixedInterval = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("offset")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Offset = value; + } + + continue; + } + + if (reader.ValueTextEquals("order")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Order = value; + } + + continue; + } + + if (reader.ValueTextEquals("params")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Params = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("time_zone")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TimeZone = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, DateHistogramAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_histogram"); + writer.WriteStartObject(); + if (value.CalendarInterval is not null) + { + writer.WritePropertyName("calendar_interval"); + JsonSerializer.Serialize(writer, value.CalendarInterval, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.FixedInterval is not null) + { + writer.WritePropertyName("fixed_interval"); + JsonSerializer.Serialize(writer, value.FixedInterval, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Offset is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, value.Offset, options); + } + + if (value.Order is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(value.Order, writer, options); + } + + if (value.Params is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, value.Params, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.TimeZone is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, value.TimeZone, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DateHistogramAggregationConverter))] +public sealed partial class DateHistogramAggregation : SearchAggregation +{ + public DateHistogramAggregation(string name) => Name = name; + + internal DateHistogramAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Calendar-aware interval.
Can be specified using the unit name, such as `month`, or as a single unit quantity, such as `1M`.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? CalendarInterval { get; set; } + + /// + /// The date field whose values are use to build a histogram. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? FixedInterval { get; set; } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public string? Format { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, all buckets between the first bucket that matches documents and the last one are returned.
+ ///
+ public int? MinDocCount { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateTimeOffset? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Offset { get; set; } + [JsonConverter(typeof(AggregateOrderConverter))] + /// + /// The sort order of the returned buckets. + /// + public ICollection>? Order { get; set; } + public IDictionary? Params { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Time zone used for bucketing and rounding.
Defaults to Coordinated Universal Time (UTC).
+ ///
+ public string? TimeZone { get; set; } +} + +public sealed partial class DateHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal DateHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public DateHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private DateTimeOffset? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } + private ICollection>? OrderValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + + public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DateHistogramAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Calendar-aware interval.
Can be specified using the unit name, such as `month`, or as a single unit quantity, such as `1M`.
+ ///
+ public DateHistogramAggregationDescriptor CalendarInterval(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// The date field whose values are use to build a histogram. + /// + public DateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build a histogram. + /// + public DateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar. + /// + public DateHistogramAggregationDescriptor FixedInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public DateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, all buckets between the first bucket that matches documents and the last one are returned.
+ ///
+ public DateHistogramAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. + /// + public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Serverless.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + /// + /// The sort order of the returned buckets. + /// + public DateHistogramAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public DateHistogramAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Time zone used for bucketing and rounding.
Defaults to Coordinated Universal Time (UTC).
+ ///
+ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_histogram"); + writer.WriteStartObject(); + if (CalendarIntervalValue is not null) + { + writer.WritePropertyName("calendar_interval"); + JsonSerializer.Serialize(writer, CalendarIntervalValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (FixedIntervalValue is not null) + { + writer.WritePropertyName("fixed_interval"); + JsonSerializer.Serialize(writer, FixedIntervalValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateHistogramAggregationDescriptor : SerializableDescriptor +{ + internal DateHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public DateHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private DateTimeOffset? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } + private ICollection>? OrderValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + + public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DateHistogramAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Calendar-aware interval.
Can be specified using the unit name, such as `month`, or as a single unit quantity, such as `1M`.
+ ///
+ public DateHistogramAggregationDescriptor CalendarInterval(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// The date field whose values are use to build a histogram. + /// + public DateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build a histogram. + /// + public DateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build a histogram. + /// + public DateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar. + /// + public DateHistogramAggregationDescriptor FixedInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + /// + /// The date format used to format `key_as_string` in the response.
If no `format` is specified, the first date format specified in the field mapping is used.
+ ///
+ public DateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, all buckets between the first bucket that matches documents and the last one are returned.
+ ///
+ public DateHistogramAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. + /// + public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Serverless.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + /// + /// The sort order of the returned buckets. + /// + public DateHistogramAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public DateHistogramAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Time zone used for bucketing and rounding.
Defaults to Coordinated Universal Time (UTC).
+ ///
+ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_histogram"); + writer.WriteStartObject(); + if (CalendarIntervalValue is not null) + { + writer.WritePropertyName("calendar_interval"); + JsonSerializer.Serialize(writer, CalendarIntervalValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (FixedIntervalValue is not null) + { + writer.WritePropertyName("fixed_interval"); + JsonSerializer.Serialize(writer, FixedIntervalValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs new file mode 100644 index 00000000000..6ad64f9b284 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(DateHistogramBucketConverter))] +public sealed partial class DateHistogramBucket : AggregateDictionary +{ + public DateHistogramBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public long Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } +} + +internal sealed class DateHistogramBucketConverter : JsonConverter +{ + public override DateHistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + long key = default; + string? keyAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new DateHistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, DateHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregate.g.cs new file mode 100644 index 00000000000..d082bff5151 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregate.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of a `date_range` aggregation. Same format as a for a `range` aggregation: `from` and `to`
in `buckets` are milliseconds since the Epoch, represented as a floating point number.
+///
+public sealed partial class DateRangeAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs new file mode 100644 index 00000000000..a370fa2b9d5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs @@ -0,0 +1,680 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class DateRangeAggregationConverter : JsonConverter +{ + public override DateRangeAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "date_range") + throw new JsonException("Unexpected JSON detected."); + var agg = new DateRangeAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("ranges")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Ranges = value; + } + + continue; + } + + if (reader.ValueTextEquals("time_zone")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TimeZone = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, DateRangeAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_range"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Ranges is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, value.Ranges, options); + } + + if (value.TimeZone is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, value.TimeZone, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DateRangeAggregationConverter))] +public sealed partial class DateRangeAggregation : SearchAggregation +{ + public DateRangeAggregation(string name) => Name = name; + + internal DateRangeAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The date field whose values are use to build ranges. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// The date format used to format `from` and `to` in the response. + /// + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// Array of date ranges. + /// + public ICollection? Ranges { get; set; } + + /// + /// Time zone used to convert dates from another time zone to UTC. + /// + public string? TimeZone { get; set; } +} + +public sealed partial class DateRangeAggregationDescriptor : SerializableDescriptor> +{ + internal DateRangeAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public DateRangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private ICollection? RangesValue { get; set; } + private DateRangeExpressionDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private string? TimeZoneValue { get; set; } + + public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DateRangeAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date format used to format `from` and `to` in the response. + /// + public DateRangeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateRangeAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Array of date ranges. + /// + public DateRangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(DateRangeExpressionDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + /// + /// Time zone used to convert dates from another time zone to UTC. + /// + public DateRangeAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateRangeAggregationDescriptor : SerializableDescriptor +{ + internal DateRangeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public DateRangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private ICollection? RangesValue { get; set; } + private DateRangeExpressionDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private string? TimeZoneValue { get; set; } + + public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DateRangeAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date format used to format `from` and `to` in the response. + /// + public DateRangeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public DateRangeAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Array of date ranges. + /// + public DateRangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(DateRangeExpressionDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public DateRangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + /// + /// Time zone used to convert dates from another time zone to UTC. + /// + public DateRangeAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("date_range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeExpression.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeExpression.g.cs new file mode 100644 index 00000000000..abd106510a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeExpression.g.cs @@ -0,0 +1,113 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class DateRangeExpression +{ + /// + /// Start of the range (inclusive). + /// + [JsonInclude, JsonPropertyName("from")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? From { get; set; } + + /// + /// Custom key to return the range with. + /// + [JsonInclude, JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// End of the range (exclusive). + /// + [JsonInclude, JsonPropertyName("to")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? To { get; set; } +} + +public sealed partial class DateRangeExpressionDescriptor : SerializableDescriptor +{ + internal DateRangeExpressionDescriptor(Action configure) => configure.Invoke(this); + + public DateRangeExpressionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? FromValue { get; set; } + private string? KeyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? ToValue { get; set; } + + /// + /// Start of the range (inclusive). + /// + public DateRangeExpressionDescriptor From(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? from) + { + FromValue = from; + return Self; + } + + /// + /// Custom key to return the range with. + /// + public DateRangeExpressionDescriptor Key(string? key) + { + KeyValue = key; + return Self; + } + + /// + /// End of the range (exclusive). + /// + public DateRangeExpressionDescriptor To(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FieldDateMath? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (!string.IsNullOrEmpty(KeyValue)) + { + writer.WritePropertyName("key"); + writer.WriteStringValue(KeyValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs new file mode 100644 index 00000000000..ef311f8d77b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class DerivativeAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("normalized_value")] + public double? NormalizedValue { get; init; } + [JsonInclude, JsonPropertyName("normalized_value_as_string")] + public string? NormalizedValueAsString { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs new file mode 100644 index 00000000000..edaeb7085b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class DerivativeAggregationConverter : JsonConverter +{ + public override DerivativeAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "derivative") + throw new JsonException("Unexpected JSON detected."); + var agg = new DerivativeAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, DerivativeAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("derivative"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DerivativeAggregationConverter))] +public sealed partial class DerivativeAggregation : SearchAggregation +{ + public DerivativeAggregation(string name) => Name = name; + + internal DerivativeAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class DerivativeAggregationDescriptor : SerializableDescriptor +{ + internal DerivativeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public DerivativeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public DerivativeAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public DerivativeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DerivativeAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public DerivativeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("derivative"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs new file mode 100644 index 00000000000..f8247174251 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs @@ -0,0 +1,554 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class DiversifiedSamplerAggregationConverter : JsonConverter +{ + public override DiversifiedSamplerAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "diversified_sampler") + throw new JsonException("Unexpected JSON detected."); + var agg = new DiversifiedSamplerAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("execution_hint")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ExecutionHint = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("max_docs_per_value")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MaxDocsPerValue = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, DiversifiedSamplerAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("diversified_sampler"); + writer.WriteStartObject(); + if (value.ExecutionHint is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, value.ExecutionHint, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.MaxDocsPerValue.HasValue) + { + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(value.MaxDocsPerValue.Value); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DiversifiedSamplerAggregationConverter))] +public sealed partial class DiversifiedSamplerAggregation : SearchAggregation +{ + public DiversifiedSamplerAggregation(string name) => Name = name; + + internal DiversifiedSamplerAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The type of value used for de-duplication. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? ExecutionHint { get; set; } + + /// + /// The field used to provide values used for de-duplication. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Limits how many documents are permitted per choice of de-duplicating value. + /// + public int? MaxDocsPerValue { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public int? ShardSize { get; set; } +} + +public sealed partial class DiversifiedSamplerAggregationDescriptor : SerializableDescriptor> +{ + internal DiversifiedSamplerAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public DiversifiedSamplerAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? MaxDocsPerValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? ShardSizeValue { get; set; } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The type of value used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field used to provide values used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field used to provide values used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Limits how many documents are permitted per choice of de-duplicating value. + /// + public DiversifiedSamplerAggregationDescriptor MaxDocsPerValue(int? maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public DiversifiedSamplerAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("diversified_sampler"); + writer.WriteStartObject(); + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MaxDocsPerValueValue.HasValue) + { + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DiversifiedSamplerAggregationDescriptor : SerializableDescriptor +{ + internal DiversifiedSamplerAggregationDescriptor(Action configure) => configure.Invoke(this); + + public DiversifiedSamplerAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? MaxDocsPerValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? ShardSizeValue { get; set; } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The type of value used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field used to provide values used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field used to provide values used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field used to provide values used for de-duplication. + /// + public DiversifiedSamplerAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Limits how many documents are permitted per choice of de-duplicating value. + /// + public DiversifiedSamplerAggregationDescriptor MaxDocsPerValue(int? maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DiversifiedSamplerAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public DiversifiedSamplerAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("diversified_sampler"); + writer.WriteStartObject(); + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MaxDocsPerValueValue.HasValue) + { + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs new file mode 100644 index 00000000000..70c7506f6f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance. +/// +public sealed partial class DoubleTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error_upper_bound")] + public long? DocCountErrorUpperBound { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("sum_other_doc_count")] + public long? SumOtherDocCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs new file mode 100644 index 00000000000..1fee5cfed4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(DoubleTermsBucketConverter))] +public sealed partial class DoubleTermsBucket : AggregateDictionary +{ + public DoubleTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error")] + public long? DocCountError { get; init; } + [JsonInclude, JsonPropertyName("key")] + public double Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } +} + +internal sealed class DoubleTermsBucketConverter : JsonConverter +{ + public override DoubleTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + long? docCountError = default; + double key = default; + string? keyAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("doc_count_error", StringComparison.Ordinal)) + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new DoubleTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, DoubleTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs new file mode 100644 index 00000000000..fedb4c95f79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ExtendedStatsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("avg")] + public double? Avg { get; init; } + [JsonInclude, JsonPropertyName("avg_as_string")] + public string? AvgAsString { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double? Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double? Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation")] + public double? StdDeviation { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_as_string")] + public string? StdDeviationAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_bounds")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StandardDeviationBounds? StdDeviationBounds { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_bounds_as_string")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StandardDeviationBoundsAsString? StdDeviationBoundsAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_population")] + public double? StdDeviationPopulation { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_sampling")] + public double? StdDeviationSampling { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public double Sum { get; init; } + [JsonInclude, JsonPropertyName("sum_as_string")] + public string? SumAsString { get; init; } + [JsonInclude, JsonPropertyName("sum_of_squares")] + public double? SumOfSquares { get; init; } + [JsonInclude, JsonPropertyName("sum_of_squares_as_string")] + public string? SumOfSquaresAsString { get; init; } + [JsonInclude, JsonPropertyName("variance")] + public double? Variance { get; init; } + [JsonInclude, JsonPropertyName("variance_as_string")] + public string? VarianceAsString { get; init; } + [JsonInclude, JsonPropertyName("variance_population")] + public double? VariancePopulation { get; init; } + [JsonInclude, JsonPropertyName("variance_population_as_string")] + public string? VariancePopulationAsString { get; init; } + [JsonInclude, JsonPropertyName("variance_sampling")] + public double? VarianceSampling { get; init; } + [JsonInclude, JsonPropertyName("variance_sampling_as_string")] + public string? VarianceSamplingAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs new file mode 100644 index 00000000000..90e23788802 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs @@ -0,0 +1,412 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ExtendedStatsAggregationConverter : JsonConverter +{ + public override ExtendedStatsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "extended_stats") + throw new JsonException("Unexpected JSON detected."); + var agg = new ExtendedStatsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("sigma")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Sigma = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ExtendedStatsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("extended_stats"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.Sigma.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(value.Sigma.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ExtendedStatsAggregationConverter))] +public sealed partial class ExtendedStatsAggregation : SearchAggregation +{ + public ExtendedStatsAggregation(string name, Field field) : this(name) => Field = field; + public ExtendedStatsAggregation(string name) => Name = name; + + internal ExtendedStatsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// The number of standard deviations above/below the mean to display. + /// + public double? Sigma { get; set; } +} + +public sealed partial class ExtendedStatsAggregationDescriptor : SerializableDescriptor> +{ + internal ExtendedStatsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ExtendedStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private double? SigmaValue { get; set; } + + public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ExtendedStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ExtendedStatsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public ExtendedStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of standard deviations above/below the mean to display. + /// + public ExtendedStatsAggregationDescriptor Sigma(double? sigma) + { + SigmaValue = sigma; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("extended_stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (SigmaValue.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(SigmaValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ExtendedStatsAggregationDescriptor : SerializableDescriptor +{ + internal ExtendedStatsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ExtendedStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private double? SigmaValue { get; set; } + + public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ExtendedStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ExtendedStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ExtendedStatsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public ExtendedStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of standard deviations above/below the mean to display. + /// + public ExtendedStatsAggregationDescriptor Sigma(double? sigma) + { + SigmaValue = sigma; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("extended_stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (SigmaValue.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(SigmaValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs new file mode 100644 index 00000000000..2d1e56afb66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ExtendedStatsBucketAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("avg")] + public double? Avg { get; init; } + [JsonInclude, JsonPropertyName("avg_as_string")] + public string? AvgAsString { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double? Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double? Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation")] + public double? StdDeviation { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_as_string")] + public string? StdDeviationAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_bounds")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StandardDeviationBounds? StdDeviationBounds { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_bounds_as_string")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StandardDeviationBoundsAsString? StdDeviationBoundsAsString { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_population")] + public double? StdDeviationPopulation { get; init; } + [JsonInclude, JsonPropertyName("std_deviation_sampling")] + public double? StdDeviationSampling { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public double Sum { get; init; } + [JsonInclude, JsonPropertyName("sum_as_string")] + public string? SumAsString { get; init; } + [JsonInclude, JsonPropertyName("sum_of_squares")] + public double? SumOfSquares { get; init; } + [JsonInclude, JsonPropertyName("sum_of_squares_as_string")] + public string? SumOfSquaresAsString { get; init; } + [JsonInclude, JsonPropertyName("variance")] + public double? Variance { get; init; } + [JsonInclude, JsonPropertyName("variance_as_string")] + public string? VarianceAsString { get; init; } + [JsonInclude, JsonPropertyName("variance_population")] + public double? VariancePopulation { get; init; } + [JsonInclude, JsonPropertyName("variance_population_as_string")] + public string? VariancePopulationAsString { get; init; } + [JsonInclude, JsonPropertyName("variance_sampling")] + public double? VarianceSampling { get; init; } + [JsonInclude, JsonPropertyName("variance_sampling_as_string")] + public string? VarianceSamplingAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs new file mode 100644 index 00000000000..56402b7fe96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ExtendedStatsBucketAggregationConverter : JsonConverter +{ + public override ExtendedStatsBucketAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "extended_stats_bucket") + throw new JsonException("Unexpected JSON detected."); + var agg = new ExtendedStatsBucketAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + + if (reader.ValueTextEquals("sigma")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Sigma = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ExtendedStatsBucketAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("extended_stats_bucket"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + if (value.Sigma.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(value.Sigma.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ExtendedStatsBucketAggregationConverter))] +public sealed partial class ExtendedStatsBucketAggregation : SearchAggregation +{ + public ExtendedStatsBucketAggregation(string name) => Name = name; + + internal ExtendedStatsBucketAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The number of standard deviations above/below the mean to display. + /// + public double? Sigma { get; set; } +} + +public sealed partial class ExtendedStatsBucketAggregationDescriptor : SerializableDescriptor +{ + internal ExtendedStatsBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ExtendedStatsBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? SigmaValue { get; set; } + + public ExtendedStatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public ExtendedStatsBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public ExtendedStatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public ExtendedStatsBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of standard deviations above/below the mean to display. + /// + public ExtendedStatsBucketAggregationDescriptor Sigma(double? sigma) + { + SigmaValue = sigma; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("extended_stats_bucket"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + if (SigmaValue.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(SigmaValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs new file mode 100644 index 00000000000..24b25e6c41f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class FieldDateMath : Union +{ + public FieldDateMath(Elastic.Clients.Elasticsearch.Serverless.DateMath expr) : base(expr) + { + } + + public FieldDateMath(double value) : base(value) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs new file mode 100644 index 00000000000..f91b22a5c94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(FilterAggregateConverter))] +public sealed partial class FilterAggregate : AggregateDictionary, IAggregate +{ + public FilterAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class FilterAggregateConverter : JsonConverter +{ + public override FilterAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new FilterAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, FilterAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregate.g.cs new file mode 100644 index 00000000000..a830d0c0c65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class FiltersAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs new file mode 100644 index 00000000000..9c22d351190 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs @@ -0,0 +1,427 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class FiltersAggregationConverter : JsonConverter +{ + public override FiltersAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "filters") + throw new JsonException("Unexpected JSON detected."); + var agg = new FiltersAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("filters")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Filters = value; + } + + continue; + } + + if (reader.ValueTextEquals("other_bucket")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.OtherBucket = value; + } + + continue; + } + + if (reader.ValueTextEquals("other_bucket_key")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.OtherBucketKey = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, FiltersAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("filters"); + writer.WriteStartObject(); + if (value.Filters is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, value.Filters, options); + } + + if (value.OtherBucket.HasValue) + { + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(value.OtherBucket.Value); + } + + if (!string.IsNullOrEmpty(value.OtherBucketKey)) + { + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(value.OtherBucketKey); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(FiltersAggregationConverter))] +public sealed partial class FiltersAggregation : SearchAggregation +{ + public FiltersAggregation(string name) => Name = name; + + internal FiltersAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Collection of queries from which to build buckets. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? Filters { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. + /// + public bool? OtherBucket { get; set; } + + /// + /// The key with which the other bucket is returned. + /// + public string? OtherBucketKey { get; set; } +} + +public sealed partial class FiltersAggregationDescriptor : SerializableDescriptor> +{ + internal FiltersAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public FiltersAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? FiltersValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? OtherBucketValue { get; set; } + private string? OtherBucketKeyValue { get; set; } + + public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public FiltersAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Collection of queries from which to build buckets. + /// + public FiltersAggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? filters) + { + FiltersValue = filters; + return Self; + } + + public FiltersAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. + /// + public FiltersAggregationDescriptor OtherBucket(bool? otherBucket = true) + { + OtherBucketValue = otherBucket; + return Self; + } + + /// + /// The key with which the other bucket is returned. + /// + public FiltersAggregationDescriptor OtherBucketKey(string? otherBucketKey) + { + OtherBucketKeyValue = otherBucketKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filters"); + writer.WriteStartObject(); + if (FiltersValue is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, FiltersValue, options); + } + + if (OtherBucketValue.HasValue) + { + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); + } + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) + { + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FiltersAggregationDescriptor : SerializableDescriptor +{ + internal FiltersAggregationDescriptor(Action configure) => configure.Invoke(this); + + public FiltersAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? FiltersValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? OtherBucketValue { get; set; } + private string? OtherBucketKeyValue { get; set; } + + public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public FiltersAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Collection of queries from which to build buckets. + /// + public FiltersAggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? filters) + { + FiltersValue = filters; + return Self; + } + + public FiltersAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. + /// + public FiltersAggregationDescriptor OtherBucket(bool? otherBucket = true) + { + OtherBucketValue = otherBucket; + return Self; + } + + /// + /// The key with which the other bucket is returned. + /// + public FiltersAggregationDescriptor OtherBucketKey(string? otherBucketKey) + { + OtherBucketKeyValue = otherBucketKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filters"); + writer.WriteStartObject(); + if (FiltersValue is not null) + { + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, FiltersValue, options); + } + + if (OtherBucketValue.HasValue) + { + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); + } + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) + { + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs new file mode 100644 index 00000000000..4753160433c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(FiltersBucketConverter))] +public sealed partial class FiltersBucket : AggregateDictionary +{ + public FiltersBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } +} + +internal sealed class FiltersBucketConverter : JsonConverter +{ + public override FiltersBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new FiltersBucket(subAggs) { DocCount = docCount }; + } + + public override void Write(Utf8JsonWriter writer, FiltersBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs new file mode 100644 index 00000000000..45bdf6b6fa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeoBoundsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("bounds")] + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds? Bounds { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs new file mode 100644 index 00000000000..56f59181997 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs @@ -0,0 +1,367 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeoBoundsAggregationConverter : JsonConverter +{ + public override GeoBoundsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geo_bounds") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeoBoundsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("wrap_longitude")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.WrapLongitude = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeoBoundsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_bounds"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.WrapLongitude.HasValue) + { + writer.WritePropertyName("wrap_longitude"); + writer.WriteBooleanValue(value.WrapLongitude.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoBoundsAggregationConverter))] +public sealed partial class GeoBoundsAggregation : SearchAggregation +{ + public GeoBoundsAggregation(string name, Field field) : this(name) => Field = field; + public GeoBoundsAggregation(string name) => Name = name; + + internal GeoBoundsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Specifies whether the bounding box should be allowed to overlap the international date line. + /// + public bool? WrapLongitude { get; set; } +} + +public sealed partial class GeoBoundsAggregationDescriptor : SerializableDescriptor> +{ + internal GeoBoundsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeoBoundsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private bool? WrapLongitudeValue { get; set; } + + public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public GeoBoundsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoBoundsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoBoundsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public GeoBoundsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Specifies whether the bounding box should be allowed to overlap the international date line. + /// + public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitude = true) + { + WrapLongitudeValue = wrapLongitude; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_bounds"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (WrapLongitudeValue.HasValue) + { + writer.WritePropertyName("wrap_longitude"); + writer.WriteBooleanValue(WrapLongitudeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoBoundsAggregationDescriptor : SerializableDescriptor +{ + internal GeoBoundsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeoBoundsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private bool? WrapLongitudeValue { get; set; } + + public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public GeoBoundsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoBoundsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoBoundsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoBoundsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public GeoBoundsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Specifies whether the bounding box should be allowed to overlap the international date line. + /// + public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitude = true) + { + WrapLongitudeValue = wrapLongitude; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_bounds"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (WrapLongitudeValue.HasValue) + { + writer.WritePropertyName("wrap_longitude"); + writer.WriteBooleanValue(WrapLongitudeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs new file mode 100644 index 00000000000..2743788a100 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeoCentroidAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("location")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? Location { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs new file mode 100644 index 00000000000..079955eba25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs @@ -0,0 +1,402 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeoCentroidAggregationConverter : JsonConverter +{ + public override GeoCentroidAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geo_centroid") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeoCentroidAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Count = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("location")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Location = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeoCentroidAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_centroid"); + writer.WriteStartObject(); + if (value.Count.HasValue) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(value.Count.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Location is not null) + { + writer.WritePropertyName("location"); + JsonSerializer.Serialize(writer, value.Location, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoCentroidAggregationConverter))] +public sealed partial class GeoCentroidAggregation : SearchAggregation +{ + public GeoCentroidAggregation(string name, Field field) : this(name) => Field = field; + public GeoCentroidAggregation(string name) => Name = name; + + internal GeoCentroidAggregation() + { + } + + public long? Count { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? Location { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class GeoCentroidAggregationDescriptor : SerializableDescriptor> +{ + internal GeoCentroidAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeoCentroidAggregationDescriptor() : base() + { + } + + private long? CountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? LocationValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public GeoCentroidAggregationDescriptor Count(long? count) + { + CountValue = count; + return Self; + } + + public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public GeoCentroidAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? location) + { + LocationValue = location; + return Self; + } + + public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_centroid"); + writer.WriteStartObject(); + if (CountValue.HasValue) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(CountValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (LocationValue is not null) + { + writer.WritePropertyName("location"); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoCentroidAggregationDescriptor : SerializableDescriptor +{ + internal GeoCentroidAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeoCentroidAggregationDescriptor() : base() + { + } + + private long? CountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? LocationValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public GeoCentroidAggregationDescriptor Count(long? count) + { + CountValue = count; + return Self; + } + + public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public GeoCentroidAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoCentroidAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? location) + { + LocationValue = location; + return Self; + } + + public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_centroid"); + writer.WriteStartObject(); + if (CountValue.HasValue) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(CountValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (LocationValue is not null) + { + writer.WritePropertyName("location"); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs new file mode 100644 index 00000000000..66504e2ca74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of a `geo_distance` aggregation. The unit for `from` and `to` is meters by default. +/// +public sealed partial class GeoDistanceAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs new file mode 100644 index 00000000000..a3c388cef1a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs @@ -0,0 +1,680 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeoDistanceAggregationConverter : JsonConverter +{ + public override GeoDistanceAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geo_distance") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeoDistanceAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("distance_type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.DistanceType = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("origin")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Origin = value; + } + + continue; + } + + if (reader.ValueTextEquals("ranges")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Ranges = value; + } + + continue; + } + + if (reader.ValueTextEquals("unit")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Unit = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeoDistanceAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_distance"); + writer.WriteStartObject(); + if (value.DistanceType is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, value.DistanceType, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Origin is not null) + { + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, value.Origin, options); + } + + if (value.Ranges is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, value.Ranges, options); + } + + if (value.Unit is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, value.Unit, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoDistanceAggregationConverter))] +public sealed partial class GeoDistanceAggregation : SearchAggregation +{ + public GeoDistanceAggregation(string name) => Name = name; + + internal GeoDistanceAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The distance calculation type. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceType { get; set; } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The origin used to evaluate the distance. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? Origin { get; set; } + + /// + /// An array of ranges used to bucket documents. + /// + public ICollection? Ranges { get; set; } + + /// + /// The distance unit. + /// + public Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? Unit { get; set; } +} + +public sealed partial class GeoDistanceAggregationDescriptor : SerializableDescriptor> +{ + internal GeoDistanceAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDistanceAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? OriginValue { get; set; } + private ICollection? RangesValue { get; set; } + private AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? UnitValue { get; set; } + + public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeoDistanceAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The distance calculation type. + /// + public GeoDistanceAggregationDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The origin used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? origin) + { + OriginValue = origin; + return Self; + } + + /// + /// An array of ranges used to bucket documents. + /// + public GeoDistanceAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(AggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + /// + /// The distance unit. + /// + public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + { + UnitValue = unit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_distance"); + writer.WriteStartObject(); + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (OriginValue is not null) + { + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDistanceAggregationDescriptor : SerializableDescriptor +{ + internal GeoDistanceAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeoDistanceAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? OriginValue { get; set; } + private ICollection? RangesValue { get; set; } + private AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? UnitValue { get; set; } + + public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeoDistanceAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The distance calculation type. + /// + public GeoDistanceAggregationDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// A field of type `geo_point` used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The origin used to evaluate the distance. + /// + public GeoDistanceAggregationDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? origin) + { + OriginValue = origin; + return Self; + } + + /// + /// An array of ranges used to bucket documents. + /// + public GeoDistanceAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(AggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + /// + /// The distance unit. + /// + public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + { + UnitValue = unit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_distance"); + writer.WriteStartObject(); + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (OriginValue is not null) + { + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregate.g.cs new file mode 100644 index 00000000000..b2072a2fefa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregate.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeoLineAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("geometry")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLine Geometry { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("properties")] + public object Properties { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs new file mode 100644 index 00000000000..f1f7b46f592 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs @@ -0,0 +1,536 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeoLineAggregationConverter : JsonConverter +{ + public override GeoLineAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geo_line") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeoLineAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("include_sort")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.IncludeSort = value; + } + + continue; + } + + if (reader.ValueTextEquals("point")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.Point = value; + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("sort")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.Sort = value; + continue; + } + + if (reader.ValueTextEquals("sort_order")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.SortOrder = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeoLineAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_line"); + writer.WriteStartObject(); + if (value.IncludeSort.HasValue) + { + writer.WritePropertyName("include_sort"); + writer.WriteBooleanValue(value.IncludeSort.Value); + } + + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, value.Point, options); + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + if (value.SortOrder is not null) + { + writer.WritePropertyName("sort_order"); + JsonSerializer.Serialize(writer, value.SortOrder, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoLineAggregationConverter))] +public sealed partial class GeoLineAggregation : SearchAggregation +{ + public GeoLineAggregation(string name) => Name = name; + + internal GeoLineAggregation() + { + } + + /// + /// When `true`, returns an additional array of the sort values in the feature properties. + /// + public bool? IncludeSort { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The name of the geo_point field. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePoint Point { get; set; } + + /// + /// The maximum length of the line represented in the aggregation.
Valid sizes are between 1 and 10000.
+ ///
+ public int? Size { get; set; } + + /// + /// The name of the numeric field to use as the sort key for ordering the points.
When the `geo_line` aggregation is nested inside a `time_series` aggregation, this field defaults to `@timestamp`, and any other value will result in error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort Sort { get; set; } + + /// + /// The order in which the line is sorted (ascending or descending). + /// + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrder { get; set; } +} + +public sealed partial class GeoLineAggregationDescriptor : SerializableDescriptor> +{ + internal GeoLineAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeoLineAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePoint PointValue { get; set; } + private GeoLinePointDescriptor PointDescriptor { get; set; } + private Action> PointDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort SortValue { get; set; } + private GeoLineSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private bool? IncludeSortValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrderValue { get; set; } + + /// + /// The name of the geo_point field. + /// + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePoint point) + { + PointDescriptor = null; + PointDescriptorAction = null; + PointValue = point; + return Self; + } + + public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + { + PointValue = null; + PointDescriptorAction = null; + PointDescriptor = descriptor; + return Self; + } + + public GeoLineAggregationDescriptor Point(Action> configure) + { + PointValue = null; + PointDescriptor = null; + PointDescriptorAction = configure; + return Self; + } + + /// + /// The name of the numeric field to use as the sort key for ordering the points.
When the `geo_line` aggregation is nested inside a `time_series` aggregation, this field defaults to `@timestamp`, and any other value will result in error.
+ ///
+ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortValue = sort; + return Self; + } + + public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptor = descriptor; + return Self; + } + + public GeoLineAggregationDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = configure; + return Self; + } + + /// + /// When `true`, returns an additional array of the sort values in the feature properties. + /// + public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = true) + { + IncludeSortValue = includeSort; + return Self; + } + + public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The maximum length of the line represented in the aggregation.
Valid sizes are between 1 and 10000.
+ ///
+ public GeoLineAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The order in which the line is sorted (ascending or descending). + /// + public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elasticsearch.Serverless.SortOrder? sortOrder) + { + SortOrderValue = sortOrder; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_line"); + writer.WriteStartObject(); + if (PointDescriptor is not null) + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, PointDescriptor, options); + } + else if (PointDescriptorAction is not null) + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + } + else + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, PointValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + } + else + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (IncludeSortValue.HasValue) + { + writer.WritePropertyName("include_sort"); + writer.WriteBooleanValue(IncludeSortValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SortOrderValue is not null) + { + writer.WritePropertyName("sort_order"); + JsonSerializer.Serialize(writer, SortOrderValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoLineAggregationDescriptor : SerializableDescriptor +{ + internal GeoLineAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeoLineAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePoint PointValue { get; set; } + private GeoLinePointDescriptor PointDescriptor { get; set; } + private Action PointDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort SortValue { get; set; } + private GeoLineSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private bool? IncludeSortValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrderValue { get; set; } + + /// + /// The name of the geo_point field. + /// + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePoint point) + { + PointDescriptor = null; + PointDescriptorAction = null; + PointValue = point; + return Self; + } + + public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + { + PointValue = null; + PointDescriptorAction = null; + PointDescriptor = descriptor; + return Self; + } + + public GeoLineAggregationDescriptor Point(Action configure) + { + PointValue = null; + PointDescriptor = null; + PointDescriptorAction = configure; + return Self; + } + + /// + /// The name of the numeric field to use as the sort key for ordering the points.
When the `geo_line` aggregation is nested inside a `time_series` aggregation, this field defaults to `@timestamp`, and any other value will result in error.
+ ///
+ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortValue = sort; + return Self; + } + + public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptor = descriptor; + return Self; + } + + public GeoLineAggregationDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = configure; + return Self; + } + + /// + /// When `true`, returns an additional array of the sort values in the feature properties. + /// + public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = true) + { + IncludeSortValue = includeSort; + return Self; + } + + public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The maximum length of the line represented in the aggregation.
Valid sizes are between 1 and 10000.
+ ///
+ public GeoLineAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// The order in which the line is sorted (ascending or descending). + /// + public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elasticsearch.Serverless.SortOrder? sortOrder) + { + SortOrderValue = sortOrder; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geo_line"); + writer.WriteStartObject(); + if (PointDescriptor is not null) + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, PointDescriptor, options); + } + else if (PointDescriptorAction is not null) + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + } + else + { + writer.WritePropertyName("point"); + JsonSerializer.Serialize(writer, PointValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + } + else + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (IncludeSortValue.HasValue) + { + writer.WritePropertyName("include_sort"); + writer.WriteBooleanValue(IncludeSortValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SortOrderValue is not null) + { + writer.WritePropertyName("sort_order"); + JsonSerializer.Serialize(writer, SortOrderValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs new file mode 100644 index 00000000000..3934e992e02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeoLinePoint +{ + /// + /// The name of the geo_point field. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } +} + +public sealed partial class GeoLinePointDescriptor : SerializableDescriptor> +{ + internal GeoLinePointDescriptor(Action> configure) => configure.Invoke(this); + + public GeoLinePointDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The name of the geo_point field. + /// + public GeoLinePointDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the geo_point field. + /// + public GeoLinePointDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class GeoLinePointDescriptor : SerializableDescriptor +{ + internal GeoLinePointDescriptor(Action configure) => configure.Invoke(this); + + public GeoLinePointDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The name of the geo_point field. + /// + public GeoLinePointDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the geo_point field. + /// + public GeoLinePointDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the geo_point field. + /// + public GeoLinePointDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs new file mode 100644 index 00000000000..1190a91075f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeoLineSort +{ + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } +} + +public sealed partial class GeoLineSortDescriptor : SerializableDescriptor> +{ + internal GeoLineSortDescriptor(Action> configure) => configure.Invoke(this); + + public GeoLineSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + public GeoLineSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + public GeoLineSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class GeoLineSortDescriptor : SerializableDescriptor +{ + internal GeoLineSortDescriptor(Action configure) => configure.Invoke(this); + + public GeoLineSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + public GeoLineSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + public GeoLineSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the numeric field to use as the sort key for ordering the points. + /// + public GeoLineSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs new file mode 100644 index 00000000000..3480803eef0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeohashGridAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs new file mode 100644 index 00000000000..3cc2436cf66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs @@ -0,0 +1,564 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeohashGridAggregationConverter : JsonConverter +{ + public override GeohashGridAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geohash_grid") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeohashGridAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("bounds")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Bounds = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("precision")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Precision = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeohashGridAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohash_grid"); + writer.WriteStartObject(); + if (value.Bounds is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, value.Bounds, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Precision is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, value.Precision, options); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeohashGridAggregationConverter))] +public sealed partial class GeohashGridAggregation : SearchAggregation +{ + public GeohashGridAggregation(string name) => Name = name; + + internal GeohashGridAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The bounding box to filter the points in each bucket. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds? Bounds { get; set; } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The string length of the geohashes used to define cells/buckets in the results. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? Precision { get; set; } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public int? ShardSize { get; set; } + + /// + /// The maximum number of geohash buckets to return. + /// + public int? Size { get; set; } +} + +public sealed partial class GeohashGridAggregationDescriptor : SerializableDescriptor> +{ + internal GeohashGridAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeohashGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeohashGridAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The bounding box to filter the points in each bucket. + /// + public GeohashGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public GeohashGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public GeohashGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeohashGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The string length of the geohashes used to define cells/buckets in the results. + /// + public GeohashGridAggregationDescriptor Precision(Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public GeohashGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The maximum number of geohash buckets to return. + /// + public GeohashGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohash_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeohashGridAggregationDescriptor : SerializableDescriptor +{ + internal GeohashGridAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeohashGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeohashGridAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The bounding box to filter the points in each bucket. + /// + public GeohashGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public GeohashGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public GeohashGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohash_grid` aggregates all array values.
+ ///
+ public GeohashGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeohashGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The string length of the geohashes used to define cells/buckets in the results. + /// + public GeohashGridAggregationDescriptor Precision(Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public GeohashGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The maximum number of geohash buckets to return. + /// + public GeohashGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohash_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs new file mode 100644 index 00000000000..797eee29495 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(GeohashGridBucketConverter))] +public sealed partial class GeohashGridBucket : AggregateDictionary +{ + public GeohashGridBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } +} + +internal sealed class GeohashGridBucketConverter : JsonConverter +{ + public override GeohashGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new GeohashGridBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, GeohashGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs new file mode 100644 index 00000000000..1667939d82a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeohexGridAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs new file mode 100644 index 00000000000..662b767ee78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs @@ -0,0 +1,548 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeohexGridAggregationConverter : JsonConverter +{ + public override GeohexGridAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geohex_grid") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeohexGridAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("bounds")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Bounds = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.Field = value; + continue; + } + + if (reader.ValueTextEquals("precision")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Precision = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeohexGridAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohex_grid"); + writer.WriteStartObject(); + if (value.Bounds is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, value.Bounds, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + if (value.Precision.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(value.Precision.Value); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeohexGridAggregationConverter))] +public sealed partial class GeohexGridAggregation : SearchAggregation +{ + public GeohexGridAggregation(string name) => Name = name; + + internal GeohexGridAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Bounding box used to filter the geo-points in each bucket. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds? Bounds { get; set; } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
+ ///
+ public int? Precision { get; set; } + + /// + /// Number of buckets returned from each shard. + /// + public int? ShardSize { get; set; } + + /// + /// Maximum number of buckets to return. + /// + public int? Size { get; set; } +} + +public sealed partial class GeohexGridAggregationDescriptor : SerializableDescriptor> +{ + internal GeohexGridAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeohexGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeohexGridAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Bounding box used to filter the geo-points in each bucket. + /// + public GeohexGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public GeohexGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public GeohexGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeohexGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
+ ///
+ public GeohexGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Number of buckets returned from each shard. + /// + public GeohexGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Maximum number of buckets to return. + /// + public GeohexGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohex_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeohexGridAggregationDescriptor : SerializableDescriptor +{ + internal GeohexGridAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeohexGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeohexGridAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Bounding box used to filter the geo-points in each bucket. + /// + public GeohexGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public GeohexGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public GeohexGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geohex_grid` aggregates all array values.
+ ///
+ public GeohexGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeohexGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
+ ///
+ public GeohexGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Number of buckets returned from each shard. + /// + public GeohexGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Maximum number of buckets to return. + /// + public GeohexGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohex_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs new file mode 100644 index 00000000000..a5ff4eb2854 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(GeohexGridBucketConverter))] +public sealed partial class GeohexGridBucket : AggregateDictionary +{ + public GeohexGridBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } +} + +internal sealed class GeohexGridBucketConverter : JsonConverter +{ + public override GeohexGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new GeohexGridBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, GeohexGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs new file mode 100644 index 00000000000..8e6cb1d6d12 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GeotileGridAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs new file mode 100644 index 00000000000..583166e2594 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs @@ -0,0 +1,564 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GeotileGridAggregationConverter : JsonConverter +{ + public override GeotileGridAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "geotile_grid") + throw new JsonException("Unexpected JSON detected."); + var agg = new GeotileGridAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("bounds")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Bounds = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("precision")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Precision = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GeotileGridAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("geotile_grid"); + writer.WriteStartObject(); + if (value.Bounds is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, value.Bounds, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Precision is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, value.Precision, options); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeotileGridAggregationConverter))] +public sealed partial class GeotileGridAggregation : SearchAggregation +{ + public GeotileGridAggregation(string name) => Name = name; + + internal GeotileGridAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// A bounding box to filter the geo-points or geo-shapes in each bucket. + /// + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds? Bounds { get; set; } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
+ ///
+ public double? Precision { get; set; } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public int? ShardSize { get; set; } + + /// + /// The maximum number of buckets to return. + /// + public int? Size { get; set; } +} + +public sealed partial class GeotileGridAggregationDescriptor : SerializableDescriptor> +{ + internal GeotileGridAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GeotileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeotileGridAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// A bounding box to filter the geo-points or geo-shapes in each bucket. + /// + public GeotileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public GeotileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public GeotileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeotileGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
+ ///
+ public GeotileGridAggregationDescriptor Precision(double? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public GeotileGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The maximum number of buckets to return. + /// + public GeotileGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geotile_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeotileGridAggregationDescriptor : SerializableDescriptor +{ + internal GeotileGridAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GeotileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? PrecisionValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GeotileGridAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// A bounding box to filter the geo-points or geo-shapes in each bucket. + /// + public GeotileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public GeotileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public GeotileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing indexed `geo_point` or `geo_shape` values.
If the field contains an array, `geotile_grid` aggregates all array values.
+ ///
+ public GeotileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeotileGridAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
+ ///
+ public GeotileGridAggregationDescriptor Precision(double? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Allows for more accurate counting of the top cells returned in the final result the aggregation.
Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard.
+ ///
+ public GeotileGridAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The maximum number of buckets to return. + /// + public GeotileGridAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geotile_grid"); + writer.WriteStartObject(); + if (BoundsValue is not null) + { + writer.WritePropertyName("bounds"); + JsonSerializer.Serialize(writer, BoundsValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs new file mode 100644 index 00000000000..b29efb1ff86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(GeotileGridBucketConverter))] +public sealed partial class GeotileGridBucket : AggregateDictionary +{ + public GeotileGridBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } +} + +internal sealed class GeotileGridBucketConverter : JsonConverter +{ + public override GeotileGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new GeotileGridBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, GeotileGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs new file mode 100644 index 00000000000..a6521bec1d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(GlobalAggregateConverter))] +public sealed partial class GlobalAggregate : AggregateDictionary, IAggregate +{ + public GlobalAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class GlobalAggregateConverter : JsonConverter +{ + public override GlobalAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new GlobalAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, GlobalAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs new file mode 100644 index 00000000000..44b1e1acfc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs @@ -0,0 +1,263 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class GlobalAggregationConverter : JsonConverter +{ + public override GlobalAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "global") + throw new JsonException("Unexpected JSON detected."); + var agg = new GlobalAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, GlobalAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("global"); + writer.WriteStartObject(); + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GlobalAggregationConverter))] +public sealed partial class GlobalAggregation : SearchAggregation +{ + public GlobalAggregation(string name) => Name = name; + + internal GlobalAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class GlobalAggregationDescriptor : SerializableDescriptor> +{ + internal GlobalAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public GlobalAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + + public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GlobalAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("global"); + writer.WriteStartObject(); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GlobalAggregationDescriptor : SerializableDescriptor +{ + internal GlobalAggregationDescriptor(Action configure) => configure.Invoke(this); + + public GlobalAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + + public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public GlobalAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("global"); + writer.WriteStartObject(); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs new file mode 100644 index 00000000000..6592bf20a7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class GoogleNormalizedDistanceHeuristic +{ + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + [JsonInclude, JsonPropertyName("background_is_superset")] + public bool? BackgroundIsSuperset { get; set; } +} + +public sealed partial class GoogleNormalizedDistanceHeuristicDescriptor : SerializableDescriptor +{ + internal GoogleNormalizedDistanceHeuristicDescriptor(Action configure) => configure.Invoke(this); + + public GoogleNormalizedDistanceHeuristicDescriptor() : base() + { + } + + private bool? BackgroundIsSupersetValue { get; set; } + + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + public GoogleNormalizedDistanceHeuristicDescriptor BackgroundIsSuperset(bool? backgroundIsSuperset = true) + { + BackgroundIsSupersetValue = backgroundIsSuperset; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BackgroundIsSupersetValue.HasValue) + { + writer.WritePropertyName("background_is_superset"); + writer.WriteBooleanValue(BackgroundIsSupersetValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrMethod.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrMethod.g.cs new file mode 100644 index 00000000000..47289ba1914 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrMethod.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class HdrMethod +{ + /// + /// Specifies the resolution of values for the histogram in number of significant digits. + /// + [JsonInclude, JsonPropertyName("number_of_significant_value_digits")] + public int? NumberOfSignificantValueDigits { get; set; } +} + +public sealed partial class HdrMethodDescriptor : SerializableDescriptor +{ + internal HdrMethodDescriptor(Action configure) => configure.Invoke(this); + + public HdrMethodDescriptor() : base() + { + } + + private int? NumberOfSignificantValueDigitsValue { get; set; } + + /// + /// Specifies the resolution of values for the histogram in number of significant digits. + /// + public HdrMethodDescriptor NumberOfSignificantValueDigits(int? numberOfSignificantValueDigits) + { + NumberOfSignificantValueDigitsValue = numberOfSignificantValueDigits; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumberOfSignificantValueDigitsValue.HasValue) + { + writer.WritePropertyName("number_of_significant_value_digits"); + writer.WriteNumberValue(NumberOfSignificantValueDigitsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregate.g.cs new file mode 100644 index 00000000000..ca1937cb8c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class HistogramAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs new file mode 100644 index 00000000000..c9d4f118b8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs @@ -0,0 +1,709 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class HistogramAggregationConverter : JsonConverter +{ + public override HistogramAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "histogram") + throw new JsonException("Unexpected JSON detected."); + var agg = new HistogramAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("interval")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Interval = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("offset")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Offset = value; + } + + continue; + } + + if (reader.ValueTextEquals("order")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Order = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, HistogramAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("histogram"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Interval.HasValue) + { + writer.WritePropertyName("interval"); + writer.WriteNumberValue(value.Interval.Value); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + if (value.Missing.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(value.Missing.Value); + } + + if (value.Offset.HasValue) + { + writer.WritePropertyName("offset"); + writer.WriteNumberValue(value.Offset.Value); + } + + if (value.Order is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(value.Order, writer, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(HistogramAggregationConverter))] +public sealed partial class HistogramAggregation : SearchAggregation +{ + public HistogramAggregation(string name) => Name = name; + + internal HistogramAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The name of the field to aggregate on. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + + /// + /// The interval for the buckets.
Must be a positive decimal.
+ ///
+ public double? Interval { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, the response will fill gaps in the histogram with empty buckets.
+ ///
+ public int? MinDocCount { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public double? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.
The bucket boundaries can be shifted by using the `offset` option.
+ ///
+ public double? Offset { get; set; } + [JsonConverter(typeof(AggregateOrderConverter))] + /// + /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
+ ///
+ public ICollection>? Order { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class HistogramAggregationDescriptor : SerializableDescriptor> +{ + internal HistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public HistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private double? IntervalValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private double? MissingValue { get; set; } + private double? OffsetValue { get; set; } + private ICollection>? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public HistogramAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public HistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The interval for the buckets.
Must be a positive decimal.
+ ///
+ public HistogramAggregationDescriptor Interval(double? interval) + { + IntervalValue = interval; + return Self; + } + + public HistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, the response will fill gaps in the histogram with empty buckets.
+ ///
+ public HistogramAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public HistogramAggregationDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.
The bucket boundaries can be shifted by using the `offset` option.
+ ///
+ public HistogramAggregationDescriptor Offset(double? offset) + { + OffsetValue = offset; + return Self; + } + + /// + /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
+ ///
+ public HistogramAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public HistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("histogram"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IntervalValue.HasValue) + { + writer.WritePropertyName("interval"); + writer.WriteNumberValue(IntervalValue.Value); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (OffsetValue.HasValue) + { + writer.WritePropertyName("offset"); + writer.WriteNumberValue(OffsetValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HistogramAggregationDescriptor : SerializableDescriptor +{ + internal HistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public HistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private double? IntervalValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private double? MissingValue { get; set; } + private double? OffsetValue { get; set; } + private ICollection>? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public HistogramAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public HistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The interval for the buckets.
Must be a positive decimal.
+ ///
+ public HistogramAggregationDescriptor Interval(double? interval) + { + IntervalValue = interval; + return Self; + } + + public HistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only returns buckets that have `min_doc_count` number of documents.
By default, the response will fill gaps in the histogram with empty buckets.
+ ///
+ public HistogramAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public HistogramAggregationDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.
The bucket boundaries can be shifted by using the `offset` option.
+ ///
+ public HistogramAggregationDescriptor Offset(double? offset) + { + OffsetValue = offset; + return Self; + } + + /// + /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
+ ///
+ public HistogramAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public HistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("histogram"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IntervalValue.HasValue) + { + writer.WritePropertyName("interval"); + writer.WriteNumberValue(IntervalValue.Value); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (OffsetValue.HasValue) + { + writer.WritePropertyName("offset"); + writer.WriteNumberValue(OffsetValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs new file mode 100644 index 00000000000..6fb92c7cbbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(HistogramBucketConverter))] +public sealed partial class HistogramBucket : AggregateDictionary +{ + public HistogramBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public double Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } +} + +internal sealed class HistogramBucketConverter : JsonConverter +{ + public override HistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + double key = default; + string? keyAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new HistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, HistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs new file mode 100644 index 00000000000..e658594de19 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class InferenceAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("data")] + public IReadOnlyDictionary Data { get; init; } + [JsonInclude, JsonPropertyName("feature_importance")] + public IReadOnlyCollection? FeatureImportance { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("top_classes")] + public IReadOnlyCollection? TopClasses { get; init; } + [JsonInclude, JsonPropertyName("value")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Value { get; init; } + [JsonInclude, JsonPropertyName("warning")] + public string? Warning { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs new file mode 100644 index 00000000000..50af73b7fb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs @@ -0,0 +1,447 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class InferenceAggregationConverter : JsonConverter +{ + public override InferenceAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "inference") + throw new JsonException("Unexpected JSON detected."); + var agg = new InferenceAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + + if (reader.ValueTextEquals("inference_config")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.InferenceConfig = value; + } + + continue; + } + + if (reader.ValueTextEquals("model_id")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.ModelId = value; + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, InferenceAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("inference"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + if (value.InferenceConfig is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, value.InferenceConfig, options); + } + + writer.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, value.ModelId, options); + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(InferenceAggregationConverter))] +public sealed partial class InferenceAggregation : SearchAggregation +{ + public InferenceAggregation(string name) => Name = name; + + internal InferenceAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + + /// + /// Contains the inference type and its options. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? InferenceConfig { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The ID or alias for the trained model. + /// + public Elastic.Clients.Elasticsearch.Serverless.Name ModelId { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class InferenceAggregationDescriptor : SerializableDescriptor> +{ + internal InferenceAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? InferenceConfigValue { get; set; } + private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name ModelIdValue { get; set; } + + /// + /// Contains the inference type and its options. + /// + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferenceAggregationDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public InferenceAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public InferenceAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The ID or alias for the trained model. + /// + public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Name modelId) + { + ModelIdValue = modelId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("inference"); + writer.WriteStartObject(); + if (InferenceConfigDescriptor is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigDescriptor, options); + } + else if (InferenceConfigDescriptorAction is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceAggregationDescriptor : SerializableDescriptor +{ + internal InferenceAggregationDescriptor(Action configure) => configure.Invoke(this); + + public InferenceAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? InferenceConfigValue { get; set; } + private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name ModelIdValue { get; set; } + + /// + /// Contains the inference type and its options. + /// + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferenceAggregationDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public InferenceAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public InferenceAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The ID or alias for the trained model. + /// + public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Name modelId) + { + ModelIdValue = modelId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("inference"); + writer.WriteStartObject(); + if (InferenceConfigDescriptor is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigDescriptor, options); + } + else if (InferenceConfigDescriptorAction is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceClassImportance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceClassImportance.g.cs new file mode 100644 index 00000000000..e857a14b7ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceClassImportance.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class InferenceClassImportance +{ + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + [JsonInclude, JsonPropertyName("importance")] + public double Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs new file mode 100644 index 00000000000..53dbb960a8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(InferenceConfigConverter))] +public sealed partial class InferenceConfig +{ + internal InferenceConfig(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfig("classification", classificationInferenceOptions); + public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfig("regression", regressionInferenceOptions); +} + +internal sealed partial class InferenceConfigConverter : JsonConverter +{ + public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfig(propertyName, variant); + } + + if (propertyName == "regression") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfig(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigDescriptor : SerializableDescriptor> +{ + internal InferenceConfigDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigDescriptor Classification(Ml.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Ml.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigDescriptor : SerializableDescriptor +{ + internal InferenceConfigDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigDescriptor Classification(Ml.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Ml.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs new file mode 100644 index 00000000000..830304e4b81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class InferenceFeatureImportance +{ + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection? Classes { get; init; } + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; init; } + [JsonInclude, JsonPropertyName("importance")] + public double? Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs new file mode 100644 index 00000000000..c92cd3773e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class InferenceTopClassEntry +{ + [JsonInclude, JsonPropertyName("class_name")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue ClassName { get; init; } + [JsonInclude, JsonPropertyName("class_probability")] + public double ClassProbability { get; init; } + [JsonInclude, JsonPropertyName("class_score")] + public double ClassScore { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs new file mode 100644 index 00000000000..e5cc36e2271 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class IpPrefixAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs new file mode 100644 index 00000000000..c8b543d4590 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs @@ -0,0 +1,587 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class IpPrefixAggregationConverter : JsonConverter +{ + public override IpPrefixAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "ip_prefix") + throw new JsonException("Unexpected JSON detected."); + var agg = new IpPrefixAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("append_prefix_length")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.AppendPrefixLength = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.Field = value; + continue; + } + + if (reader.ValueTextEquals("is_ipv6")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.IsIpv6 = value; + } + + continue; + } + + if (reader.ValueTextEquals("keyed")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Keyed = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("prefix_length")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + agg.PrefixLength = value; + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, IpPrefixAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_prefix"); + writer.WriteStartObject(); + if (value.AppendPrefixLength.HasValue) + { + writer.WritePropertyName("append_prefix_length"); + writer.WriteBooleanValue(value.AppendPrefixLength.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + if (value.IsIpv6.HasValue) + { + writer.WritePropertyName("is_ipv6"); + writer.WriteBooleanValue(value.IsIpv6.Value); + } + + if (value.Keyed.HasValue) + { + writer.WritePropertyName("keyed"); + writer.WriteBooleanValue(value.Keyed.Value); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength); + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(IpPrefixAggregationConverter))] +public sealed partial class IpPrefixAggregation : SearchAggregation +{ + public IpPrefixAggregation(string name) => Name = name; + + internal IpPrefixAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Defines whether the prefix length is appended to IP address keys in the response. + /// + public bool? AppendPrefixLength { get; set; } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Defines whether the prefix applies to IPv6 addresses. + /// + public bool? IsIpv6 { get; set; } + + /// + /// Defines whether buckets are returned as a hash rather than an array in the response. + /// + public bool? Keyed { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// Minimum number of documents in a bucket for it to be included in the response. + /// + public long? MinDocCount { get; set; } + override public string? Name { get; internal set; } + + /// + /// Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].
For IPv6 addresses the accepted range is [0, 128].
+ ///
+ public int PrefixLength { get; set; } +} + +public sealed partial class IpPrefixAggregationDescriptor : SerializableDescriptor> +{ + internal IpPrefixAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public IpPrefixAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private bool? AppendPrefixLengthValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? IsIpv6Value { get; set; } + private bool? KeyedValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private int PrefixLengthValue { get; set; } + + public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public IpPrefixAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Defines whether the prefix length is appended to IP address keys in the response. + /// + public IpPrefixAggregationDescriptor AppendPrefixLength(bool? appendPrefixLength = true) + { + AppendPrefixLengthValue = appendPrefixLength; + return Self; + } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public IpPrefixAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public IpPrefixAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Defines whether the prefix applies to IPv6 addresses. + /// + public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) + { + IsIpv6Value = isIpv6; + return Self; + } + + /// + /// Defines whether buckets are returned as a hash rather than an array in the response. + /// + public IpPrefixAggregationDescriptor Keyed(bool? keyed = true) + { + KeyedValue = keyed; + return Self; + } + + public IpPrefixAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Minimum number of documents in a bucket for it to be included in the response. + /// + public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].
For IPv6 addresses the accepted range is [0, 128].
+ ///
+ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_prefix"); + writer.WriteStartObject(); + if (AppendPrefixLengthValue.HasValue) + { + writer.WritePropertyName("append_prefix_length"); + writer.WriteBooleanValue(AppendPrefixLengthValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IsIpv6Value.HasValue) + { + writer.WritePropertyName("is_ipv6"); + writer.WriteBooleanValue(IsIpv6Value.Value); + } + + if (KeyedValue.HasValue) + { + writer.WritePropertyName("keyed"); + writer.WriteBooleanValue(KeyedValue.Value); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IpPrefixAggregationDescriptor : SerializableDescriptor +{ + internal IpPrefixAggregationDescriptor(Action configure) => configure.Invoke(this); + + public IpPrefixAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private bool? AppendPrefixLengthValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? IsIpv6Value { get; set; } + private bool? KeyedValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private int PrefixLengthValue { get; set; } + + public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public IpPrefixAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Defines whether the prefix length is appended to IP address keys in the response. + /// + public IpPrefixAggregationDescriptor AppendPrefixLength(bool? appendPrefixLength = true) + { + AppendPrefixLengthValue = appendPrefixLength; + return Self; + } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public IpPrefixAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public IpPrefixAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The IP address field to aggregation on. The field mapping type must be `ip`. + /// + public IpPrefixAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Defines whether the prefix applies to IPv6 addresses. + /// + public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) + { + IsIpv6Value = isIpv6; + return Self; + } + + /// + /// Defines whether buckets are returned as a hash rather than an array in the response. + /// + public IpPrefixAggregationDescriptor Keyed(bool? keyed = true) + { + KeyedValue = keyed; + return Self; + } + + public IpPrefixAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Minimum number of documents in a bucket for it to be included in the response. + /// + public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].
For IPv6 addresses the accepted range is [0, 128].
+ ///
+ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_prefix"); + writer.WriteStartObject(); + if (AppendPrefixLengthValue.HasValue) + { + writer.WritePropertyName("append_prefix_length"); + writer.WriteBooleanValue(AppendPrefixLengthValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IsIpv6Value.HasValue) + { + writer.WritePropertyName("is_ipv6"); + writer.WriteBooleanValue(IsIpv6Value.Value); + } + + if (KeyedValue.HasValue) + { + writer.WritePropertyName("keyed"); + writer.WriteBooleanValue(KeyedValue.Value); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs new file mode 100644 index 00000000000..bd624a23465 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs @@ -0,0 +1,112 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(IpPrefixBucketConverter))] +public sealed partial class IpPrefixBucket : AggregateDictionary +{ + public IpPrefixBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("is_ipv6")] + public bool IsIpv6 { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } + [JsonInclude, JsonPropertyName("netmask")] + public string? Netmask { get; init; } + [JsonInclude, JsonPropertyName("prefix_length")] + public int PrefixLength { get; init; } +} + +internal sealed class IpPrefixBucketConverter : JsonConverter +{ + public override IpPrefixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + bool isIpv6 = default; + string key = default; + string? netmask = default; + int prefixLength = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("is_ipv6", StringComparison.Ordinal)) + { + isIpv6 = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("netmask", StringComparison.Ordinal)) + { + netmask = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("prefix_length", StringComparison.Ordinal)) + { + prefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new IpPrefixBucket(subAggs) { DocCount = docCount, IsIpv6 = isIpv6, Key = key, Netmask = netmask, PrefixLength = prefixLength }; + } + + public override void Write(Utf8JsonWriter writer, IpPrefixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregate.g.cs new file mode 100644 index 00000000000..93fe5cb476e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class IpRangeAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs new file mode 100644 index 00000000000..6ad91948613 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs @@ -0,0 +1,515 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class IpRangeAggregationConverter : JsonConverter +{ + public override IpRangeAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "ip_range") + throw new JsonException("Unexpected JSON detected."); + var agg = new IpRangeAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("ranges")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Ranges = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, IpRangeAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_range"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Ranges is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, value.Ranges, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(IpRangeAggregationConverter))] +public sealed partial class IpRangeAggregation : SearchAggregation +{ + public IpRangeAggregation(string name) => Name = name; + + internal IpRangeAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The date field whose values are used to build ranges. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Array of IP ranges. + /// + public ICollection? Ranges { get; set; } +} + +public sealed partial class IpRangeAggregationDescriptor : SerializableDescriptor> +{ + internal IpRangeAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public IpRangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection? RangesValue { get; set; } + private IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + + public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public IpRangeAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public IpRangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Array of IP ranges. + /// + public IpRangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(IpRangeAggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IpRangeAggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new IpRangeAggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IpRangeAggregationDescriptor : SerializableDescriptor +{ + internal IpRangeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public IpRangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection? RangesValue { get; set; } + private IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + + public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public IpRangeAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public IpRangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Array of IP ranges. + /// + public IpRangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(IpRangeAggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public IpRangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("ip_range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IpRangeAggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new IpRangeAggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs new file mode 100644 index 00000000000..520fda546e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs @@ -0,0 +1,113 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class IpRangeAggregationRange +{ + /// + /// Start of the range. + /// + [JsonInclude, JsonPropertyName("from")] + public string? From { get; set; } + + /// + /// IP range defined as a CIDR mask. + /// + [JsonInclude, JsonPropertyName("mask")] + public string? Mask { get; set; } + + /// + /// End of the range. + /// + [JsonInclude, JsonPropertyName("to")] + public string? To { get; set; } +} + +public sealed partial class IpRangeAggregationRangeDescriptor : SerializableDescriptor +{ + internal IpRangeAggregationRangeDescriptor(Action configure) => configure.Invoke(this); + + public IpRangeAggregationRangeDescriptor() : base() + { + } + + private string? FromValue { get; set; } + private string? MaskValue { get; set; } + private string? ToValue { get; set; } + + /// + /// Start of the range. + /// + public IpRangeAggregationRangeDescriptor From(string? from) + { + FromValue = from; + return Self; + } + + /// + /// IP range defined as a CIDR mask. + /// + public IpRangeAggregationRangeDescriptor Mask(string? mask) + { + MaskValue = mask; + return Self; + } + + /// + /// End of the range. + /// + public IpRangeAggregationRangeDescriptor To(string? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FromValue)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(FromValue); + } + + if (!string.IsNullOrEmpty(MaskValue)) + { + writer.WritePropertyName("mask"); + writer.WriteStringValue(MaskValue); + } + + if (!string.IsNullOrEmpty(ToValue)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(ToValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeBucket.g.cs new file mode 100644 index 00000000000..67c1d506527 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeBucket.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(IpRangeBucketConverter))] +public sealed partial class IpRangeBucket : AggregateDictionary +{ + public IpRangeBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("from")] + public string? From { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string? Key { get; init; } + [JsonInclude, JsonPropertyName("to")] + public string? To { get; init; } +} + +internal sealed class IpRangeBucketConverter : JsonConverter +{ + public override IpRangeBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string? from = default; + string? key = default; + string? to = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("from", StringComparison.Ordinal)) + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("to", StringComparison.Ordinal)) + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new IpRangeBucket(subAggs) { DocCount = docCount, From = from, Key = key, To = to }; + } + + public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsAggregate.g.cs new file mode 100644 index 00000000000..c83db968258 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsAggregate.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of a `terms` aggregation when the field is some kind of whole number like a integer, long, or a date. +/// +public sealed partial class LongTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error_upper_bound")] + public long? DocCountErrorUpperBound { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("sum_other_doc_count")] + public long? SumOtherDocCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs new file mode 100644 index 00000000000..f7bb55b157c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(LongTermsBucketConverter))] +public sealed partial class LongTermsBucket : AggregateDictionary +{ + public LongTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error")] + public long? DocCountError { get; init; } + [JsonInclude, JsonPropertyName("key")] + public long Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } +} + +internal sealed class LongTermsBucketConverter : JsonConverter +{ + public override LongTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + long? docCountError = default; + long key = default; + string? keyAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("doc_count_error", StringComparison.Ordinal)) + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new LongTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, LongTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs new file mode 100644 index 00000000000..04992647c72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MatrixStatsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyCollection? Fields { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs new file mode 100644 index 00000000000..2089cd66886 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs @@ -0,0 +1,303 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MatrixStatsAggregationConverter : JsonConverter +{ + public override MatrixStatsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "matrix_stats") + throw new JsonException("Unexpected JSON detected."); + var agg = new MatrixStatsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("fields")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Fields = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("mode")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Mode = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MatrixStatsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("matrix_stats"); + writer.WriteStartObject(); + if (value.Fields is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, value.Fields, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Mode is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, value.Mode, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MatrixStatsAggregationConverter))] +public sealed partial class MatrixStatsAggregation : SearchAggregation +{ + public MatrixStatsAggregation(string name) => Name = name; + + internal MatrixStatsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + public IDictionary? Meta { get; set; } + public IDictionary? Missing { get; set; } + + /// + /// Array value the aggregation will use for array or multi-valued fields. + /// + public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class MatrixStatsAggregationDescriptor : SerializableDescriptor> +{ + internal MatrixStatsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MatrixStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private IDictionary? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + + public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public MatrixStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) + { + MissingValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Array value the aggregation will use for array or multi-valued fields. + /// + public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("matrix_stats"); + writer.WriteStartObject(); + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MatrixStatsAggregationDescriptor : SerializableDescriptor +{ + internal MatrixStatsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MatrixStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private IDictionary? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + + public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public MatrixStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) + { + MissingValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Array value the aggregation will use for array or multi-valued fields. + /// + public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("matrix_stats"); + writer.WriteStartObject(); + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsFields.g.cs new file mode 100644 index 00000000000..7938ea4a34d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsFields.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MatrixStatsFields +{ + [JsonInclude, JsonPropertyName("correlation")] + [ReadOnlyFieldDictionaryConverter(typeof(double))] + public IReadOnlyDictionary Correlation { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("covariance")] + [ReadOnlyFieldDictionaryConverter(typeof(double))] + public IReadOnlyDictionary Covariance { get; init; } + [JsonInclude, JsonPropertyName("kurtosis")] + public double Kurtosis { get; init; } + [JsonInclude, JsonPropertyName("mean")] + public double Mean { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("skewness")] + public double Skewness { get; init; } + [JsonInclude, JsonPropertyName("variance")] + public double Variance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs new file mode 100644 index 00000000000..63d0e59acb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MaxAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs new file mode 100644 index 00000000000..41cf629e31b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MaxAggregationConverter : JsonConverter +{ + public override MaxAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "max") + throw new JsonException("Unexpected JSON detected."); + var agg = new MaxAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MaxAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("max"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MaxAggregationConverter))] +public sealed partial class MaxAggregation : SearchAggregation +{ + public MaxAggregation(string name, Field field) : this(name) => Field = field; + public MaxAggregation(string name) => Name = name; + + internal MaxAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class MaxAggregationDescriptor : SerializableDescriptor> +{ + internal MaxAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MaxAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MaxAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MaxAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MaxAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MaxAggregationDescriptor : SerializableDescriptor +{ + internal MaxAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MaxAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MaxAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MaxAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MaxAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MaxAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs new file mode 100644 index 00000000000..62913538632 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MedianAbsoluteDeviationAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs new file mode 100644 index 00000000000..10bf469bb1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs @@ -0,0 +1,411 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MedianAbsoluteDeviationAggregationConverter : JsonConverter +{ + public override MedianAbsoluteDeviationAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "median_absolute_deviation") + throw new JsonException("Unexpected JSON detected."); + var agg = new MedianAbsoluteDeviationAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("compression")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Compression = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MedianAbsoluteDeviationAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("median_absolute_deviation"); + writer.WriteStartObject(); + if (value.Compression.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(value.Compression.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MedianAbsoluteDeviationAggregationConverter))] +public sealed partial class MedianAbsoluteDeviationAggregation : SearchAggregation +{ + public MedianAbsoluteDeviationAggregation(string name, Field field) : this(name) => Field = field; + public MedianAbsoluteDeviationAggregation(string name) => Name = name; + + internal MedianAbsoluteDeviationAggregation() + { + } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public double? Compression { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class MedianAbsoluteDeviationAggregationDescriptor : SerializableDescriptor> +{ + internal MedianAbsoluteDeviationAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MedianAbsoluteDeviationAggregationDescriptor() : base() + { + } + + private double? CompressionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compression) + { + CompressionValue = compression; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("median_absolute_deviation"); + writer.WriteStartObject(); + if (CompressionValue.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(CompressionValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MedianAbsoluteDeviationAggregationDescriptor : SerializableDescriptor +{ + internal MedianAbsoluteDeviationAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MedianAbsoluteDeviationAggregationDescriptor() : base() + { + } + + private double? CompressionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compression) + { + CompressionValue = compression; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("median_absolute_deviation"); + writer.WriteStartObject(); + if (CompressionValue.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(CompressionValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs new file mode 100644 index 00000000000..cef27724f4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MinAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs new file mode 100644 index 00000000000..772a3809867 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MinAggregationConverter : JsonConverter +{ + public override MinAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "min") + throw new JsonException("Unexpected JSON detected."); + var agg = new MinAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MinAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("min"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MinAggregationConverter))] +public sealed partial class MinAggregation : SearchAggregation +{ + public MinAggregation(string name, Field field) : this(name) => Field = field; + public MinAggregation(string name) => Name = name; + + internal MinAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class MinAggregationDescriptor : SerializableDescriptor> +{ + internal MinAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MinAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MinAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MinAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MinAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("min"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MinAggregationDescriptor : SerializableDescriptor +{ + internal MinAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MinAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public MinAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MinAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MinAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MinAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("min"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs new file mode 100644 index 00000000000..fd455ebcd4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(MissingAggregateConverter))] +public sealed partial class MissingAggregate : AggregateDictionary, IAggregate +{ + public MissingAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class MissingAggregateConverter : JsonConverter +{ + public override MissingAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new MissingAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, MissingAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs new file mode 100644 index 00000000000..878656ec79a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs @@ -0,0 +1,389 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MissingAggregationConverter : JsonConverter +{ + public override MissingAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "missing") + throw new JsonException("Unexpected JSON detected."); + var agg = new MissingAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MissingAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("missing"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MissingAggregationConverter))] +public sealed partial class MissingAggregation : SearchAggregation +{ + public MissingAggregation(string name) => Name = name; + + internal MissingAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The name of the field. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class MissingAggregationDescriptor : SerializableDescriptor> +{ + internal MissingAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MissingAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MissingAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MissingAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MissingAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("missing"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MissingAggregationDescriptor : SerializableDescriptor +{ + internal MissingAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MissingAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MissingAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MissingAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MissingAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("missing"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs new file mode 100644 index 00000000000..0e4a1d906aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs @@ -0,0 +1,158 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MultiTermLookup +{ + /// + /// A fields from which to retrieve terms. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public FieldValue? Missing { get; set; } +} + +public sealed partial class MultiTermLookupDescriptor : SerializableDescriptor> +{ + internal MultiTermLookupDescriptor(Action> configure) => configure.Invoke(this); + + public MultiTermLookupDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private FieldValue? MissingValue { get; set; } + + /// + /// A fields from which to retrieve terms. + /// + public MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// A fields from which to retrieve terms. + /// + public MultiTermLookupDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MultiTermLookupDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MultiTermLookupDescriptor : SerializableDescriptor +{ + internal MultiTermLookupDescriptor(Action configure) => configure.Invoke(this); + + public MultiTermLookupDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private FieldValue? MissingValue { get; set; } + + /// + /// A fields from which to retrieve terms. + /// + public MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// A fields from which to retrieve terms. + /// + public MultiTermLookupDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// A fields from which to retrieve terms. + /// + public MultiTermLookupDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MultiTermLookupDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs new file mode 100644 index 00000000000..2cbb83d7203 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MultiTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error_upper_bound")] + public long? DocCountErrorUpperBound { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("sum_other_doc_count")] + public long? SumOtherDocCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs new file mode 100644 index 00000000000..08e1e4ee1bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs @@ -0,0 +1,810 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class MultiTermsAggregationConverter : JsonConverter +{ + public override MultiTermsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "multi_terms") + throw new JsonException("Unexpected JSON detected."); + var agg = new MultiTermsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("collect_mode")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.CollectMode = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("order")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Order = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardMinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("show_term_doc_count_error")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShowTermDocCountError = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("terms")) + { + reader.Read(); + var value = JsonSerializer.Deserialize>(ref reader, options); + agg.Terms = value; + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, MultiTermsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("multi_terms"); + writer.WriteStartObject(); + if (value.CollectMode is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, value.CollectMode, options); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + if (value.Order is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(value.Order, writer, options); + } + + if (value.ShardMinDocCount.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(value.ShardMinDocCount.Value); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.ShowTermDocCountError.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(value.ShowTermDocCountError.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, value.Terms, options); + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MultiTermsAggregationConverter))] +public sealed partial class MultiTermsAggregation : SearchAggregation +{ + public MultiTermsAggregation(string name) => Name = name; + + internal MultiTermsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Specifies the strategy for data collection. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The minimum number of documents in a bucket for it to be returned. + /// + public long? MinDocCount { get; set; } + override public string? Name { get; internal set; } + [JsonConverter(typeof(AggregateOrderConverter))] + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public ICollection>? Order { get; set; } + + /// + /// The minimum number of documents in a bucket on each shard for it to be returned. + /// + public long? ShardMinDocCount { get; set; } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public int? ShardSize { get; set; } + + /// + /// Calculates the doc count error on per term basis. + /// + public bool? ShowTermDocCountError { get; set; } + + /// + /// The number of term buckets should be returned out of the overall terms list. + /// + public int? Size { get; set; } + + /// + /// The field from which to generate sets of terms. + /// + public ICollection Terms { get; set; } +} + +public sealed partial class MultiTermsAggregationDescriptor : SerializableDescriptor> +{ + internal MultiTermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public MultiTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private ICollection TermsValue { get; set; } + private MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + private Action>[] TermsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private ICollection>? OrderValue { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private bool? ShowTermDocCountErrorValue { get; set; } + private int? SizeValue { get; set; } + + public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultiTermsAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The field from which to generate sets of terms. + /// + public MultiTermsAggregationDescriptor Terms(ICollection terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsDescriptorActions = null; + TermsValue = terms; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(MultiTermLookupDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptorActions = null; + TermsDescriptor = descriptor; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(Action> configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorActions = null; + TermsDescriptorAction = configure; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(params Action>[] configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsDescriptorActions = configure; + return Self; + } + + /// + /// Specifies the strategy for data collection. + /// + public MultiTermsAggregationDescriptor CollectMode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? collectMode) + { + CollectModeValue = collectMode; + return Self; + } + + public MultiTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum number of documents in a bucket for it to be returned. + /// + public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public MultiTermsAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + /// + /// The minimum number of documents in a bucket on each shard for it to be returned. + /// + public MultiTermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public MultiTermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Calculates the doc count error on per term basis. + /// + public MultiTermsAggregationDescriptor ShowTermDocCountError(bool? showTermDocCountError = true) + { + ShowTermDocCountErrorValue = showTermDocCountError; + return Self; + } + + /// + /// The number of term buckets should be returned out of the overall terms list. + /// + public MultiTermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("multi_terms"); + writer.WriteStartObject(); + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + writer.WriteEndArray(); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TermsDescriptorActions is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + foreach (var action in TermsDescriptorActions) + { + JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + if (CollectModeValue is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, CollectModeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (ShowTermDocCountErrorValue.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(ShowTermDocCountErrorValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MultiTermsAggregationDescriptor : SerializableDescriptor +{ + internal MultiTermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MultiTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private ICollection TermsValue { get; set; } + private MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + private Action[] TermsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private ICollection>? OrderValue { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private bool? ShowTermDocCountErrorValue { get; set; } + private int? SizeValue { get; set; } + + public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultiTermsAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The field from which to generate sets of terms. + /// + public MultiTermsAggregationDescriptor Terms(ICollection terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsDescriptorActions = null; + TermsValue = terms; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(MultiTermLookupDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptorActions = null; + TermsDescriptor = descriptor; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(Action configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorActions = null; + TermsDescriptorAction = configure; + return Self; + } + + public MultiTermsAggregationDescriptor Terms(params Action[] configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsDescriptorActions = configure; + return Self; + } + + /// + /// Specifies the strategy for data collection. + /// + public MultiTermsAggregationDescriptor CollectMode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? collectMode) + { + CollectModeValue = collectMode; + return Self; + } + + public MultiTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum number of documents in a bucket for it to be returned. + /// + public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public MultiTermsAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + /// + /// The minimum number of documents in a bucket on each shard for it to be returned. + /// + public MultiTermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public MultiTermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Calculates the doc count error on per term basis. + /// + public MultiTermsAggregationDescriptor ShowTermDocCountError(bool? showTermDocCountError = true) + { + ShowTermDocCountErrorValue = showTermDocCountError; + return Self; + } + + /// + /// The number of term buckets should be returned out of the overall terms list. + /// + public MultiTermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("multi_terms"); + writer.WriteStartObject(); + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + writer.WriteEndArray(); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TermsDescriptorActions is not null) + { + writer.WritePropertyName("terms"); + writer.WriteStartArray(); + foreach (var action in TermsDescriptorActions) + { + JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + if (CollectModeValue is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, CollectModeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (ShowTermDocCountErrorValue.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(ShowTermDocCountErrorValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs new file mode 100644 index 00000000000..54f117427ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(MultiTermsBucketConverter))] +public sealed partial class MultiTermsBucket : AggregateDictionary +{ + public MultiTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error_upper_bound")] + public long? DocCountErrorUpperBound { get; init; } + [JsonInclude, JsonPropertyName("key")] + public IReadOnlyCollection Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } +} + +internal sealed class MultiTermsBucketConverter : JsonConverter +{ + public override MultiTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + long? docCountErrorUpperBound = default; + IReadOnlyCollection key = default; + string? keyAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("doc_count_error_upper_bound", StringComparison.Ordinal)) + { + docCountErrorUpperBound = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new MultiTermsBucket(subAggs) { DocCount = docCount, DocCountErrorUpperBound = docCountErrorUpperBound, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, MultiTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs new file mode 100644 index 00000000000..e45373a5b21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class MutualInformationHeuristic +{ + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + [JsonInclude, JsonPropertyName("background_is_superset")] + public bool? BackgroundIsSuperset { get; set; } + + /// + /// Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. + /// + [JsonInclude, JsonPropertyName("include_negatives")] + public bool? IncludeNegatives { get; set; } +} + +public sealed partial class MutualInformationHeuristicDescriptor : SerializableDescriptor +{ + internal MutualInformationHeuristicDescriptor(Action configure) => configure.Invoke(this); + + public MutualInformationHeuristicDescriptor() : base() + { + } + + private bool? BackgroundIsSupersetValue { get; set; } + private bool? IncludeNegativesValue { get; set; } + + /// + /// Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. + /// + public MutualInformationHeuristicDescriptor BackgroundIsSuperset(bool? backgroundIsSuperset = true) + { + BackgroundIsSupersetValue = backgroundIsSuperset; + return Self; + } + + /// + /// Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. + /// + public MutualInformationHeuristicDescriptor IncludeNegatives(bool? includeNegatives = true) + { + IncludeNegativesValue = includeNegatives; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BackgroundIsSupersetValue.HasValue) + { + writer.WritePropertyName("background_is_superset"); + writer.WriteBooleanValue(BackgroundIsSupersetValue.Value); + } + + if (IncludeNegativesValue.HasValue) + { + writer.WritePropertyName("include_negatives"); + writer.WriteBooleanValue(IncludeNegativesValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs new file mode 100644 index 00000000000..85293f2c831 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(NestedAggregateConverter))] +public sealed partial class NestedAggregate : AggregateDictionary, IAggregate +{ + public NestedAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class NestedAggregateConverter : JsonConverter +{ + public override NestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new NestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, NestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs new file mode 100644 index 00000000000..34568118aa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs @@ -0,0 +1,344 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class NestedAggregationConverter : JsonConverter +{ + public override NestedAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "nested") + throw new JsonException("Unexpected JSON detected."); + var agg = new NestedAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Path = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, NestedAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("nested"); + writer.WriteStartObject(); + if (value.Path is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, value.Path, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(NestedAggregationConverter))] +public sealed partial class NestedAggregation : SearchAggregation +{ + public NestedAggregation(string name) => Name = name; + + internal NestedAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The path to the field of type `nested`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } +} + +public sealed partial class NestedAggregationDescriptor : SerializableDescriptor> +{ + internal NestedAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public NestedAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + + public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public NestedAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("nested"); + writer.WriteStartObject(); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class NestedAggregationDescriptor : SerializableDescriptor +{ + internal NestedAggregationDescriptor(Action configure) => configure.Invoke(this); + + public NestedAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + + public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public NestedAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("nested"); + writer.WriteStartObject(); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs new file mode 100644 index 00000000000..a65e02b96d5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(ParentAggregateConverter))] +public sealed partial class ParentAggregate : AggregateDictionary, IAggregate +{ + public ParentAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class ParentAggregateConverter : JsonConverter +{ + public override ParentAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new ParentAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, ParentAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs new file mode 100644 index 00000000000..2e1f7a447ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs @@ -0,0 +1,317 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ParentAggregationConverter : JsonConverter +{ + public override ParentAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "parent") + throw new JsonException("Unexpected JSON detected."); + var agg = new ParentAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Type = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ParentAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("parent"); + writer.WriteStartObject(); + if (value.Type is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, value.Type, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ParentAggregationConverter))] +public sealed partial class ParentAggregation : SearchAggregation +{ + public ParentAggregation(string name) => Name = name; + + internal ParentAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The child type that should be selected. + /// + public string? Type { get; set; } +} + +public sealed partial class ParentAggregationDescriptor : SerializableDescriptor> +{ + internal ParentAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ParentAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private string? TypeValue { get; set; } + + public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ParentAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The child type that should be selected. + /// + public ParentAggregationDescriptor Type(string? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("parent"); + writer.WriteStartObject(); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ParentAggregationDescriptor : SerializableDescriptor +{ + internal ParentAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ParentAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private string? TypeValue { get; set; } + + public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ParentAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The child type that should be selected. + /// + public ParentAggregationDescriptor Type(string? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("parent"); + writer.WriteStartObject(); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs new file mode 100644 index 00000000000..068983056fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class PercentageScoreHeuristic +{ +} + +public sealed partial class PercentageScoreHeuristicDescriptor : SerializableDescriptor +{ + internal PercentageScoreHeuristicDescriptor(Action configure) => configure.Invoke(this); + + public PercentageScoreHeuristicDescriptor() : base() + { + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs new file mode 100644 index 00000000000..88a702fe9ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs @@ -0,0 +1,642 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class PercentileRanksAggregationConverter : JsonConverter +{ + public override PercentileRanksAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "percentile_ranks") + throw new JsonException("Unexpected JSON detected."); + var agg = new PercentileRanksAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("hdr")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Hdr = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("tdigest")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TDigest = value; + } + + continue; + } + + if (reader.ValueTextEquals("values")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Values = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, PercentileRanksAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentile_ranks"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Hdr is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, value.Hdr, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.TDigest is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, value.TDigest, options); + } + + if (value.Values is not null) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, value.Values, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(PercentileRanksAggregationConverter))] +public sealed partial class PercentileRanksAggregation : SearchAggregation +{ + public PercentileRanksAggregation(string name, Field field) : this(name) => Field = field; + public PercentileRanksAggregation(string name) => Name = name; + + internal PercentileRanksAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? Hdr { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentile ranks. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigest { get; set; } + + /// + /// An array of values for which to calculate the percentile ranks. + /// + public ICollection? Values { get; set; } +} + +public sealed partial class PercentileRanksAggregationDescriptor : SerializableDescriptor> +{ + internal PercentileRanksAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public PercentileRanksAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? HdrValue { get; set; } + private HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigestValue { get; set; } + private TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + private ICollection? ValuesValue { get; set; } + + public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public PercentileRanksAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentileRanksAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. + /// + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? hdr) + { + HdrDescriptor = null; + HdrDescriptorAction = null; + HdrValue = hdr; + return Self; + } + + public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + { + HdrValue = null; + HdrDescriptorAction = null; + HdrDescriptor = descriptor; + return Self; + } + + public PercentileRanksAggregationDescriptor Hdr(Action configure) + { + HdrValue = null; + HdrDescriptor = null; + HdrDescriptorAction = configure; + return Self; + } + + public PercentileRanksAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public PercentileRanksAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentile ranks. + /// + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? tDigest) + { + TDigestDescriptor = null; + TDigestDescriptorAction = null; + TDigestValue = tDigest; + return Self; + } + + public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + { + TDigestValue = null; + TDigestDescriptorAction = null; + TDigestDescriptor = descriptor; + return Self; + } + + public PercentileRanksAggregationDescriptor TDigest(Action configure) + { + TDigestValue = null; + TDigestDescriptor = null; + TDigestDescriptorAction = configure; + return Self; + } + + /// + /// An array of values for which to calculate the percentile ranks. + /// + public PercentileRanksAggregationDescriptor Values(ICollection? values) + { + ValuesValue = values; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentile_ranks"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (HdrDescriptor is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrDescriptor, options); + } + else if (HdrDescriptorAction is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + } + else if (HdrValue is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TDigestDescriptor is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestDescriptor, options); + } + else if (TDigestDescriptorAction is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + } + else if (TDigestValue is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestValue, options); + } + + if (ValuesValue is not null) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, ValuesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PercentileRanksAggregationDescriptor : SerializableDescriptor +{ + internal PercentileRanksAggregationDescriptor(Action configure) => configure.Invoke(this); + + public PercentileRanksAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? HdrValue { get; set; } + private HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigestValue { get; set; } + private TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + private ICollection? ValuesValue { get; set; } + + public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public PercentileRanksAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentileRanksAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentileRanksAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. + /// + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? hdr) + { + HdrDescriptor = null; + HdrDescriptorAction = null; + HdrValue = hdr; + return Self; + } + + public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + { + HdrValue = null; + HdrDescriptorAction = null; + HdrDescriptor = descriptor; + return Self; + } + + public PercentileRanksAggregationDescriptor Hdr(Action configure) + { + HdrValue = null; + HdrDescriptor = null; + HdrDescriptorAction = configure; + return Self; + } + + public PercentileRanksAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public PercentileRanksAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentile ranks. + /// + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? tDigest) + { + TDigestDescriptor = null; + TDigestDescriptorAction = null; + TDigestValue = tDigest; + return Self; + } + + public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + { + TDigestValue = null; + TDigestDescriptorAction = null; + TDigestDescriptor = descriptor; + return Self; + } + + public PercentileRanksAggregationDescriptor TDigest(Action configure) + { + TDigestValue = null; + TDigestDescriptor = null; + TDigestDescriptorAction = configure; + return Self; + } + + /// + /// An array of values for which to calculate the percentile ranks. + /// + public PercentileRanksAggregationDescriptor Values(ICollection? values) + { + ValuesValue = values; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentile_ranks"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (HdrDescriptor is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrDescriptor, options); + } + else if (HdrDescriptorAction is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + } + else if (HdrValue is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TDigestDescriptor is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestDescriptor, options); + } + else if (TDigestDescriptorAction is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + } + else if (TDigestValue is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestValue, options); + } + + if (ValuesValue is not null) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, ValuesValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs new file mode 100644 index 00000000000..bbba65e6980 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class Percentiles : Union, IReadOnlyCollection> +{ + public Percentiles(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public Percentiles(IReadOnlyCollection collection) : base(collection) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs new file mode 100644 index 00000000000..813927cecbe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs @@ -0,0 +1,642 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class PercentilesAggregationConverter : JsonConverter +{ + public override PercentilesAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "percentiles") + throw new JsonException("Unexpected JSON detected."); + var agg = new PercentilesAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("hdr")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Hdr = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("percents")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Percents = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("tdigest")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TDigest = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, PercentilesAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentiles"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Hdr is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, value.Hdr, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Percents is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, value.Percents, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.TDigest is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, value.TDigest, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(PercentilesAggregationConverter))] +public sealed partial class PercentilesAggregation : SearchAggregation +{ + public PercentilesAggregation(string name, Field field) : this(name) => Field = field; + public PercentilesAggregation(string name) => Name = name; + + internal PercentilesAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? Hdr { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// The percentiles to calculate. + /// + public ICollection? Percents { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentiles. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigest { get; set; } +} + +public sealed partial class PercentilesAggregationDescriptor : SerializableDescriptor> +{ + internal PercentilesAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public PercentilesAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? HdrValue { get; set; } + private HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private ICollection? PercentsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigestValue { get; set; } + private TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + + public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public PercentilesAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentilesAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. + /// + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? hdr) + { + HdrDescriptor = null; + HdrDescriptorAction = null; + HdrValue = hdr; + return Self; + } + + public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + { + HdrValue = null; + HdrDescriptorAction = null; + HdrDescriptor = descriptor; + return Self; + } + + public PercentilesAggregationDescriptor Hdr(Action configure) + { + HdrValue = null; + HdrDescriptor = null; + HdrDescriptorAction = configure; + return Self; + } + + public PercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercentilesAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// The percentiles to calculate. + /// + public PercentilesAggregationDescriptor Percents(ICollection? percents) + { + PercentsValue = percents; + return Self; + } + + public PercentilesAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentiles. + /// + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? tDigest) + { + TDigestDescriptor = null; + TDigestDescriptorAction = null; + TDigestValue = tDigest; + return Self; + } + + public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + { + TDigestValue = null; + TDigestDescriptorAction = null; + TDigestDescriptor = descriptor; + return Self; + } + + public PercentilesAggregationDescriptor TDigest(Action configure) + { + TDigestValue = null; + TDigestDescriptor = null; + TDigestDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentiles"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (HdrDescriptor is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrDescriptor, options); + } + else if (HdrDescriptorAction is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + } + else if (HdrValue is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PercentsValue is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, PercentsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TDigestDescriptor is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestDescriptor, options); + } + else if (TDigestDescriptorAction is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + } + else if (TDigestValue is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PercentilesAggregationDescriptor : SerializableDescriptor +{ + internal PercentilesAggregationDescriptor(Action configure) => configure.Invoke(this); + + public PercentilesAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? HdrValue { get; set; } + private HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private ICollection? PercentsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigestValue { get; set; } + private TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + + public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public PercentilesAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentilesAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PercentilesAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. + /// + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethod? hdr) + { + HdrDescriptor = null; + HdrDescriptorAction = null; + HdrValue = hdr; + return Self; + } + + public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + { + HdrValue = null; + HdrDescriptorAction = null; + HdrDescriptor = descriptor; + return Self; + } + + public PercentilesAggregationDescriptor Hdr(Action configure) + { + HdrValue = null; + HdrDescriptor = null; + HdrDescriptorAction = configure; + return Self; + } + + public PercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercentilesAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// The percentiles to calculate. + /// + public PercentilesAggregationDescriptor Percents(ICollection? percents) + { + PercentsValue = percents; + return Self; + } + + public PercentilesAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Sets parameters for the default TDigest algorithm used to calculate percentiles. + /// + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? tDigest) + { + TDigestDescriptor = null; + TDigestDescriptorAction = null; + TDigestValue = tDigest; + return Self; + } + + public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + { + TDigestValue = null; + TDigestDescriptorAction = null; + TDigestDescriptor = descriptor; + return Self; + } + + public PercentilesAggregationDescriptor TDigest(Action configure) + { + TDigestValue = null; + TDigestDescriptor = null; + TDigestDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentiles"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (HdrDescriptor is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrDescriptor, options); + } + else if (HdrDescriptorAction is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + } + else if (HdrValue is not null) + { + writer.WritePropertyName("hdr"); + JsonSerializer.Serialize(writer, HdrValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PercentsValue is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, PercentsValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TDigestDescriptor is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestDescriptor, options); + } + else if (TDigestDescriptorAction is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + } + else if (TDigestValue is not null) + { + writer.WritePropertyName("tdigest"); + JsonSerializer.Serialize(writer, TDigestValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs new file mode 100644 index 00000000000..e29d1a9a062 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class PercentilesBucketAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.Percentiles Values { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs new file mode 100644 index 00000000000..2a4d8ab1667 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class PercentilesBucketAggregationConverter : JsonConverter +{ + public override PercentilesBucketAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "percentiles_bucket") + throw new JsonException("Unexpected JSON detected."); + var agg = new PercentilesBucketAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + + if (reader.ValueTextEquals("percents")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Percents = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, PercentilesBucketAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentiles_bucket"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + if (value.Percents is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, value.Percents, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(PercentilesBucketAggregationConverter))] +public sealed partial class PercentilesBucketAggregation : SearchAggregation +{ + public PercentilesBucketAggregation(string name) => Name = name; + + internal PercentilesBucketAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The list of percentiles to calculate. + /// + public ICollection? Percents { get; set; } +} + +public sealed partial class PercentilesBucketAggregationDescriptor : SerializableDescriptor +{ + internal PercentilesBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public PercentilesBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection? PercentsValue { get; set; } + + public PercentilesBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public PercentilesBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public PercentilesBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public PercentilesBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The list of percentiles to calculate. + /// + public PercentilesBucketAggregationDescriptor Percents(ICollection? percents) + { + PercentsValue = percents; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("percentiles_bucket"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + if (PercentsValue is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, PercentsValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregate.g.cs new file mode 100644 index 00000000000..b27d6bb4052 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class RangeAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs new file mode 100644 index 00000000000..673162d0a8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs @@ -0,0 +1,660 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class RangeAggregationConverter : JsonConverter +{ + public override RangeAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "range") + throw new JsonException("Unexpected JSON detected."); + var agg = new RangeAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("ranges")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Ranges = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, RangeAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("range"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(value.Missing.Value); + } + + if (value.Ranges is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, value.Ranges, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(RangeAggregationConverter))] +public sealed partial class RangeAggregation : SearchAggregation +{ + public RangeAggregation(string name) => Name = name; + + internal RangeAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// The date field whose values are use to build ranges. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public int? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// An array of ranges used to bucket documents. + /// + public ICollection? Ranges { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class RangeAggregationDescriptor : SerializableDescriptor> +{ + internal RangeAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public RangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MissingValue { get; set; } + private ICollection? RangesValue { get; set; } + private AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public RangeAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RangeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public RangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RangeAggregationDescriptor Missing(int? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// An array of ranges used to bucket documents. + /// + public RangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public RangeAggregationDescriptor Ranges(AggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public RangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public RangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RangeAggregationDescriptor : SerializableDescriptor +{ + internal RangeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public RangeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MissingValue { get; set; } + private ICollection? RangesValue { get; set; } + private AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public RangeAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RangeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public RangeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RangeAggregationDescriptor Missing(int? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// An array of ranges used to bucket documents. + /// + public RangeAggregationDescriptor Ranges(ICollection? ranges) + { + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesValue = ranges; + return Self; + } + + public RangeAggregationDescriptor Ranges(AggregationRangeDescriptor descriptor) + { + RangesValue = null; + RangesDescriptorAction = null; + RangesDescriptorActions = null; + RangesDescriptor = descriptor; + return Self; + } + + public RangeAggregationDescriptor Ranges(Action configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorActions = null; + RangesDescriptorAction = configure; + return Self; + } + + public RangeAggregationDescriptor Ranges(params Action[] configure) + { + RangesValue = null; + RangesDescriptor = null; + RangesDescriptorAction = null; + RangesDescriptorActions = configure; + return Self; + } + + public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("range"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (RangesDescriptor is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RangesDescriptor, options); + writer.WriteEndArray(); + } + else if (RangesDescriptorAction is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RangesDescriptorActions is not null) + { + writer.WritePropertyName("ranges"); + writer.WriteStartArray(); + foreach (var action in RangesDescriptorActions) + { + JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (RangesValue is not null) + { + writer.WritePropertyName("ranges"); + JsonSerializer.Serialize(writer, RangesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs new file mode 100644 index 00000000000..b987f36dc06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(RangeBucketConverter))] +public sealed partial class RangeBucket : AggregateDictionary +{ + public RangeBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("from")] + public double? From { get; init; } + [JsonInclude, JsonPropertyName("from_as_string")] + public string? FromAsString { get; init; } + + /// + /// The bucket key. Present if the aggregation is _not_ keyed + /// + [JsonInclude, JsonPropertyName("key")] + public string? Key { get; init; } + [JsonInclude, JsonPropertyName("to")] + public double? To { get; init; } + [JsonInclude, JsonPropertyName("to_as_string")] + public string? ToAsString { get; init; } +} + +internal sealed class RangeBucketConverter : JsonConverter +{ + public override RangeBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + double? from = default; + string? fromAsString = default; + string? key = default; + double? to = default; + string? toAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("from", StringComparison.Ordinal)) + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("from_as_string", StringComparison.Ordinal)) + { + fromAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("to", StringComparison.Ordinal)) + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("to_as_string", StringComparison.Ordinal)) + { + toAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new RangeBucket(subAggs) { DocCount = docCount, From = from, FromAsString = fromAsString, Key = key, To = to, ToAsString = toAsString }; + } + + public override void Write(Utf8JsonWriter writer, RangeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs new file mode 100644 index 00000000000..4d17762441f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs @@ -0,0 +1,664 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class RareTermsAggregationConverter : JsonConverter +{ + public override RareTermsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "rare_terms") + throw new JsonException("Unexpected JSON detected."); + var agg = new RareTermsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("exclude")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Exclude = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("include")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Include = value; + } + + continue; + } + + if (reader.ValueTextEquals("max_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MaxDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("precision")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Precision = value; + } + + continue; + } + + if (reader.ValueTextEquals("value_type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ValueType = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, RareTermsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("rare_terms"); + writer.WriteStartObject(); + if (value.Exclude is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, value.Exclude, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Include is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, value.Include, options); + } + + if (value.MaxDocCount.HasValue) + { + writer.WritePropertyName("max_doc_count"); + writer.WriteNumberValue(value.MaxDocCount.Value); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Precision.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(value.Precision.Value); + } + + if (!string.IsNullOrEmpty(value.ValueType)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(value.ValueType); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(RareTermsAggregationConverter))] +public sealed partial class RareTermsAggregation : SearchAggregation +{ + public RareTermsAggregation(string name) => Name = name; + + internal RareTermsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Terms that should be excluded from the aggregation. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } + + /// + /// The field from which to return rare terms. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Terms that should be included in the aggregation. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } + + /// + /// The maximum number of documents a term should appear in. + /// + public long? MaxDocCount { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
+ ///
+ public double? Precision { get; set; } + public string? ValueType { get; set; } +} + +public sealed partial class RareTermsAggregationDescriptor : SerializableDescriptor> +{ + internal RareTermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public RareTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private long? MaxDocCountValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private double? PrecisionValue { get; set; } + private string? ValueTypeValue { get; set; } + + public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public RareTermsAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Terms that should be excluded from the aggregation. + /// + public RareTermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// The field from which to return rare terms. + /// + public RareTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return rare terms. + /// + public RareTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Terms that should be included in the aggregation. + /// + public RareTermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// The maximum number of documents a term should appear in. + /// + public RareTermsAggregationDescriptor MaxDocCount(long? maxDocCount) + { + MaxDocCountValue = maxDocCount; + return Self; + } + + public RareTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RareTermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
+ ///
+ public RareTermsAggregationDescriptor Precision(double? precision) + { + PrecisionValue = precision; + return Self; + } + + public RareTermsAggregationDescriptor ValueType(string? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("rare_terms"); + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MaxDocCountValue.HasValue) + { + writer.WritePropertyName("max_doc_count"); + writer.WriteNumberValue(MaxDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (!string.IsNullOrEmpty(ValueTypeValue)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(ValueTypeValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RareTermsAggregationDescriptor : SerializableDescriptor +{ + internal RareTermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public RareTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private long? MaxDocCountValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private double? PrecisionValue { get; set; } + private string? ValueTypeValue { get; set; } + + public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public RareTermsAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Terms that should be excluded from the aggregation. + /// + public RareTermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// The field from which to return rare terms. + /// + public RareTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return rare terms. + /// + public RareTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return rare terms. + /// + public RareTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Terms that should be included in the aggregation. + /// + public RareTermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// The maximum number of documents a term should appear in. + /// + public RareTermsAggregationDescriptor MaxDocCount(long? maxDocCount) + { + MaxDocCountValue = maxDocCount; + return Self; + } + + public RareTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RareTermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
+ ///
+ public RareTermsAggregationDescriptor Precision(double? precision) + { + PrecisionValue = precision; + return Self; + } + + public RareTermsAggregationDescriptor ValueType(string? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("rare_terms"); + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MaxDocCountValue.HasValue) + { + writer.WritePropertyName("max_doc_count"); + writer.WriteNumberValue(MaxDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (!string.IsNullOrEmpty(ValueTypeValue)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(ValueTypeValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregate.g.cs new file mode 100644 index 00000000000..303bfe634f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class RateAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs new file mode 100644 index 00000000000..3f8b8082e45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs @@ -0,0 +1,467 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class RateAggregationConverter : JsonConverter +{ + public override RateAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "rate") + throw new JsonException("Unexpected JSON detected."); + var agg = new RateAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("mode")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Mode = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("unit")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Unit = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, RateAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("rate"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Mode is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, value.Mode, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.Unit is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, value.Unit, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(RateAggregationConverter))] +public sealed partial class RateAggregation : SearchAggregation +{ + public RateAggregation(string name, Field field) : this(name) => Field = field; + public RateAggregation(string name) => Name = name; + + internal RateAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + + /// + /// How the rate is calculated. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? Mode { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// The interval used to calculate the rate.
By default, the interval of the `date_histogram` is used.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? Unit { get; set; } +} + +public sealed partial class RateAggregationDescriptor : SerializableDescriptor> +{ + internal RateAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public RateAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? UnitValue { get; set; } + + public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public RateAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RateAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RateAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// How the rate is calculated. + /// + public RateAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? mode) + { + ModeValue = mode; + return Self; + } + + public RateAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The interval used to calculate the rate.
By default, the interval of the `date_histogram` is used.
+ ///
+ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? unit) + { + UnitValue = unit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("rate"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RateAggregationDescriptor : SerializableDescriptor +{ + internal RateAggregationDescriptor(Action configure) => configure.Invoke(this); + + public RateAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? UnitValue { get; set; } + + public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public RateAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RateAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RateAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RateAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// How the rate is calculated. + /// + public RateAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? mode) + { + ModeValue = mode; + return Self; + } + + public RateAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The interval used to calculate the rate.
By default, the interval of the `date_histogram` is used.
+ ///
+ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? unit) + { + UnitValue = unit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("rate"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs new file mode 100644 index 00000000000..ecfc8cdd211 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(ReverseNestedAggregateConverter))] +public sealed partial class ReverseNestedAggregate : AggregateDictionary, IAggregate +{ + public ReverseNestedAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class ReverseNestedAggregateConverter : JsonConverter +{ + public override ReverseNestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new ReverseNestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, ReverseNestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs new file mode 100644 index 00000000000..3379ae55ced --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs @@ -0,0 +1,344 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ReverseNestedAggregationConverter : JsonConverter +{ + public override ReverseNestedAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "reverse_nested") + throw new JsonException("Unexpected JSON detected."); + var agg = new ReverseNestedAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Path = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ReverseNestedAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("reverse_nested"); + writer.WriteStartObject(); + if (value.Path is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, value.Path, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ReverseNestedAggregationConverter))] +public sealed partial class ReverseNestedAggregation : SearchAggregation +{ + public ReverseNestedAggregation(string name) => Name = name; + + internal ReverseNestedAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } +} + +public sealed partial class ReverseNestedAggregationDescriptor : SerializableDescriptor> +{ + internal ReverseNestedAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ReverseNestedAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + + public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ReverseNestedAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public ReverseNestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public ReverseNestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("reverse_nested"); + writer.WriteStartObject(); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ReverseNestedAggregationDescriptor : SerializableDescriptor +{ + internal ReverseNestedAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ReverseNestedAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + + public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public ReverseNestedAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public ReverseNestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public ReverseNestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + /// + /// Defines the nested object field that should be joined back to.
The default is empty, which means that it joins back to the root/main document level.
+ ///
+ public ReverseNestedAggregationDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("reverse_nested"); + writer.WriteStartObject(); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregate.g.cs new file mode 100644 index 00000000000..a24bff99e58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregate.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(SamplerAggregateConverter))] +public sealed partial class SamplerAggregate : AggregateDictionary, IAggregate +{ + public SamplerAggregate(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} + +internal sealed class SamplerAggregateConverter : JsonConverter +{ + public override SamplerAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + IReadOnlyDictionary? meta = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("meta", StringComparison.Ordinal)) + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new SamplerAggregate(subAggs) { DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, SamplerAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs new file mode 100644 index 00000000000..de2e22c80fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs @@ -0,0 +1,317 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class SamplerAggregationConverter : JsonConverter +{ + public override SamplerAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "sampler") + throw new JsonException("Unexpected JSON detected."); + var agg = new SamplerAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, SamplerAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("sampler"); + writer.WriteStartObject(); + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SamplerAggregationConverter))] +public sealed partial class SamplerAggregation : SearchAggregation +{ + public SamplerAggregation(string name) => Name = name; + + internal SamplerAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public int? ShardSize { get; set; } +} + +public sealed partial class SamplerAggregationDescriptor : SerializableDescriptor> +{ + internal SamplerAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public SamplerAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private int? ShardSizeValue { get; set; } + + public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SamplerAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public SamplerAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sampler"); + writer.WriteStartObject(); + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SamplerAggregationDescriptor : SerializableDescriptor +{ + internal SamplerAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SamplerAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private int? ShardSizeValue { get; set; } + + public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SamplerAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Limits how many top-scoring documents are collected in the sample processed on each shard. + /// + public SamplerAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sampler"); + writer.WriteStartObject(); + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs new file mode 100644 index 00000000000..a580fdf699b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ScriptedHeuristic +{ + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } +} + +public sealed partial class ScriptedHeuristicDescriptor : SerializableDescriptor +{ + internal ScriptedHeuristicDescriptor(Action configure) => configure.Invoke(this); + + public ScriptedHeuristicDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + public ScriptedHeuristicDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs new file mode 100644 index 00000000000..51ddfb89dc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class ScriptedMetricAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public object Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs new file mode 100644 index 00000000000..a749aff76cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs @@ -0,0 +1,586 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ScriptedMetricAggregationConverter : JsonConverter +{ + public override ScriptedMetricAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "scripted_metric") + throw new JsonException("Unexpected JSON detected."); + var agg = new ScriptedMetricAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("combine_script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.CombineScript = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("init_script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.InitScript = value; + } + + continue; + } + + if (reader.ValueTextEquals("map_script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MapScript = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("params")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Params = value; + } + + continue; + } + + if (reader.ValueTextEquals("reduce_script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ReduceScript = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ScriptedMetricAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("scripted_metric"); + writer.WriteStartObject(); + if (value.CombineScript is not null) + { + writer.WritePropertyName("combine_script"); + JsonSerializer.Serialize(writer, value.CombineScript, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.InitScript is not null) + { + writer.WritePropertyName("init_script"); + JsonSerializer.Serialize(writer, value.InitScript, options); + } + + if (value.MapScript is not null) + { + writer.WritePropertyName("map_script"); + JsonSerializer.Serialize(writer, value.MapScript, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Params is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, value.Params, options); + } + + if (value.ReduceScript is not null) + { + writer.WritePropertyName("reduce_script"); + JsonSerializer.Serialize(writer, value.ReduceScript, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ScriptedMetricAggregationConverter))] +public sealed partial class ScriptedMetricAggregation : SearchAggregation +{ + public ScriptedMetricAggregation(string name, Field field) : this(name) => Field = field; + public ScriptedMetricAggregation(string name) => Name = name; + + internal ScriptedMetricAggregation() + { + } + + /// + /// Runs once on each shard after document collection is complete.
Allows the aggregation to consolidate the state returned from each shard.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Script? CombineScript { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Runs prior to any collection of documents.
Allows the aggregation to set up any initial state.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Script? InitScript { get; set; } + + /// + /// Run once per document collected.
If no `combine_script` is specified, the resulting state needs to be stored in the `state` object.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Script? MapScript { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + + /// + /// A global object with script parameters for `init`, `map` and `combine` scripts.
It is shared between the scripts.
+ ///
+ public IDictionary? Params { get; set; } + + /// + /// Runs once on the coordinating node after all shards have returned their results.
The script is provided with access to a variable `states`, which is an array of the result of the `combine_script` on each shard.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Script? ReduceScript { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class ScriptedMetricAggregationDescriptor : SerializableDescriptor> +{ + internal ScriptedMetricAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptedMetricAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script? CombineScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? InitScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? MapScriptValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ReduceScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Runs once on each shard after document collection is complete.
Allows the aggregation to consolidate the state returned from each shard.
+ ///
+ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clients.Elasticsearch.Serverless.Script? combineScript) + { + CombineScriptValue = combineScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ScriptedMetricAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Runs prior to any collection of documents.
Allows the aggregation to set up any initial state.
+ ///
+ public ScriptedMetricAggregationDescriptor InitScript(Elastic.Clients.Elasticsearch.Serverless.Script? initScript) + { + InitScriptValue = initScript; + return Self; + } + + /// + /// Run once per document collected.
If no `combine_script` is specified, the resulting state needs to be stored in the `state` object.
+ ///
+ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients.Elasticsearch.Serverless.Script? mapScript) + { + MapScriptValue = mapScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// A global object with script parameters for `init`, `map` and `combine` scripts.
It is shared between the scripts.
+ ///
+ public ScriptedMetricAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Runs once on the coordinating node after all shards have returned their results.
The script is provided with access to a variable `states`, which is an array of the result of the `combine_script` on each shard.
+ ///
+ public ScriptedMetricAggregationDescriptor ReduceScript(Elastic.Clients.Elasticsearch.Serverless.Script? reduceScript) + { + ReduceScriptValue = reduceScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("scripted_metric"); + writer.WriteStartObject(); + if (CombineScriptValue is not null) + { + writer.WritePropertyName("combine_script"); + JsonSerializer.Serialize(writer, CombineScriptValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (InitScriptValue is not null) + { + writer.WritePropertyName("init_script"); + JsonSerializer.Serialize(writer, InitScriptValue, options); + } + + if (MapScriptValue is not null) + { + writer.WritePropertyName("map_script"); + JsonSerializer.Serialize(writer, MapScriptValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ReduceScriptValue is not null) + { + writer.WritePropertyName("reduce_script"); + JsonSerializer.Serialize(writer, ReduceScriptValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptedMetricAggregationDescriptor : SerializableDescriptor +{ + internal ScriptedMetricAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ScriptedMetricAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script? CombineScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? InitScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? MapScriptValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ReduceScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Runs once on each shard after document collection is complete.
Allows the aggregation to consolidate the state returned from each shard.
+ ///
+ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clients.Elasticsearch.Serverless.Script? combineScript) + { + CombineScriptValue = combineScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ScriptedMetricAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ScriptedMetricAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Runs prior to any collection of documents.
Allows the aggregation to set up any initial state.
+ ///
+ public ScriptedMetricAggregationDescriptor InitScript(Elastic.Clients.Elasticsearch.Serverless.Script? initScript) + { + InitScriptValue = initScript; + return Self; + } + + /// + /// Run once per document collected.
If no `combine_script` is specified, the resulting state needs to be stored in the `state` object.
+ ///
+ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients.Elasticsearch.Serverless.Script? mapScript) + { + MapScriptValue = mapScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// A global object with script parameters for `init`, `map` and `combine` scripts.
It is shared between the scripts.
+ ///
+ public ScriptedMetricAggregationDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Runs once on the coordinating node after all shards have returned their results.
The script is provided with access to a variable `states`, which is an array of the result of the `combine_script` on each shard.
+ ///
+ public ScriptedMetricAggregationDescriptor ReduceScript(Elastic.Clients.Elasticsearch.Serverless.Script? reduceScript) + { + ReduceScriptValue = reduceScript; + return Self; + } + + public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("scripted_metric"); + writer.WriteStartObject(); + if (CombineScriptValue is not null) + { + writer.WritePropertyName("combine_script"); + JsonSerializer.Serialize(writer, CombineScriptValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (InitScriptValue is not null) + { + writer.WritePropertyName("init_script"); + JsonSerializer.Serialize(writer, InitScriptValue, options); + } + + if (MapScriptValue is not null) + { + writer.WritePropertyName("map_script"); + JsonSerializer.Serialize(writer, MapScriptValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ReduceScriptValue is not null) + { + writer.WritePropertyName("reduce_script"); + JsonSerializer.Serialize(writer, ReduceScriptValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs new file mode 100644 index 00000000000..636834cdfd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class SignificantStringTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("bg_count")] + public long? BgCount { get; init; } + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("doc_count")] + public long? DocCount { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs new file mode 100644 index 00000000000..7aad22a98e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(SignificantStringTermsBucketConverter))] +public sealed partial class SignificantStringTermsBucket : AggregateDictionary +{ + public SignificantStringTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("bg_count")] + public long BgCount { get; init; } + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double Score { get; init; } +} + +internal sealed class SignificantStringTermsBucketConverter : JsonConverter +{ + public override SignificantStringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long bgCount = default; + long docCount = default; + string key = default; + double score = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("bg_count", StringComparison.Ordinal)) + { + bgCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("score", StringComparison.Ordinal)) + { + score = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new SignificantStringTermsBucket(subAggs) { BgCount = bgCount, DocCount = docCount, Key = key, Score = score }; + } + + public override void Write(Utf8JsonWriter writer, SignificantStringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs new file mode 100644 index 00000000000..f638dd79efb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs @@ -0,0 +1,1534 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class SignificantTermsAggregationConverter : JsonConverter +{ + public override SignificantTermsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "significant_terms") + throw new JsonException("Unexpected JSON detected."); + var agg = new SignificantTermsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("background_filter")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BackgroundFilter = value; + } + + continue; + } + + if (reader.ValueTextEquals("chi_square")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ChiSquare = value; + } + + continue; + } + + if (reader.ValueTextEquals("exclude")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Exclude = value; + } + + continue; + } + + if (reader.ValueTextEquals("execution_hint")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ExecutionHint = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("gnd")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Gnd = value; + } + + continue; + } + + if (reader.ValueTextEquals("include")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Include = value; + } + + continue; + } + + if (reader.ValueTextEquals("jlh")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Jlh = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("mutual_information")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MutualInformation = value; + } + + continue; + } + + if (reader.ValueTextEquals("percentage")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Percentage = value; + } + + continue; + } + + if (reader.ValueTextEquals("script_heuristic")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ScriptHeuristic = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardMinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, SignificantTermsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("significant_terms"); + writer.WriteStartObject(); + if (value.BackgroundFilter is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, value.BackgroundFilter, options); + } + + if (value.ChiSquare is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, value.ChiSquare, options); + } + + if (value.Exclude is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, value.Exclude, options); + } + + if (value.ExecutionHint is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, value.ExecutionHint, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Gnd is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, value.Gnd, options); + } + + if (value.Include is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, value.Include, options); + } + + if (value.Jlh is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, value.Jlh, options); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + if (value.MutualInformation is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, value.MutualInformation, options); + } + + if (value.Percentage is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, value.Percentage, options); + } + + if (value.ScriptHeuristic is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, value.ScriptHeuristic, options); + } + + if (value.ShardMinDocCount.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(value.ShardMinDocCount.Value); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SignificantTermsAggregationConverter))] +public sealed partial class SignificantTermsAggregation : SearchAggregation +{ + public SignificantTermsAggregation(string name) => Name = name; + + internal SignificantTermsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? BackgroundFilter { get; set; } + + /// + /// Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquare { get; set; } + + /// + /// Terms to exclude. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } + + /// + /// Mechanism by which the aggregation should be executed: using field values directly or using global ordinals. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } + + /// + /// The field from which to return significant terms. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? Gnd { get; set; } + + /// + /// Terms to include. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } + + /// + /// Use JLH score as the significance score. + /// + public Elastic.Clients.Elasticsearch.Serverless.EmptyObject? Jlh { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// Only return terms that are found in more than `min_doc_count` hits. + /// + public long? MinDocCount { get; set; } + + /// + /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? MutualInformation { get; set; } + override public string? Name { get; internal set; } + + /// + /// A simple calculation of the number of documents in the foreground sample with a term divided by the number of documents in the background with the term. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? Percentage { get; set; } + + /// + /// Customized score, implemented via a script. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristic { get; set; } + + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public long? ShardMinDocCount { get; set; } + + /// + /// Can be used to control the volumes of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public int? ShardSize { get; set; } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public int? Size { get; set; } +} + +public sealed partial class SignificantTermsAggregationDescriptor : SerializableDescriptor> +{ + internal SignificantTermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public SignificantTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? BackgroundFilterValue { get; set; } + private QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action> BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.EmptyObject? JlhValue { get; set; } + private EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } + private MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index. + /// + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor BackgroundFilter(Action> configure) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = configure; + return Self; + } + + /// + /// Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score. + /// + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Terms to exclude. + /// + public SignificantTermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Mechanism by which the aggregation should be executed: using field values directly or using global ordinals. + /// + public SignificantTermsAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant terms. + /// + public SignificantTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant terms. + /// + public SignificantTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Terms to include. + /// + public SignificantTermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only return terms that are found in more than `min_doc_count` hits. + /// + public SignificantTermsAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. + /// + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + /// + /// A simple calculation of the number of documents in the foreground sample with a term divided by the number of documents in the background with the term. + /// + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// Can be used to control the volumes of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public SignificantTermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("significant_terms"); + writer.WriteStartObject(); + if (BackgroundFilterDescriptor is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, BackgroundFilterDescriptor, options); + } + else if (BackgroundFilterDescriptorAction is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + } + else if (BackgroundFilterValue is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, BackgroundFilterValue, options); + } + + if (ChiSquareDescriptor is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, ChiSquareDescriptor, options); + } + else if (ChiSquareDescriptorAction is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + } + else if (ChiSquareValue is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, ChiSquareValue, options); + } + + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (GndDescriptor is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, GndDescriptor, options); + } + else if (GndDescriptorAction is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + } + else if (GndValue is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, GndValue, options); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (JlhDescriptor is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhDescriptor, options); + } + else if (JlhDescriptorAction is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MutualInformationDescriptor is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationDescriptor, options); + } + else if (MutualInformationDescriptorAction is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (PercentageDescriptor is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, PercentageDescriptor, options); + } + else if (PercentageDescriptorAction is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + } + else if (PercentageValue is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, PercentageValue, options); + } + + if (ScriptHeuristicDescriptor is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, ScriptHeuristicDescriptor, options); + } + else if (ScriptHeuristicDescriptorAction is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + } + else if (ScriptHeuristicValue is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, ScriptHeuristicValue, options); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SignificantTermsAggregationDescriptor : SerializableDescriptor +{ + internal SignificantTermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SignificantTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? BackgroundFilterValue { get; set; } + private QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.EmptyObject? JlhValue { get; set; } + private EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } + private MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + + public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index. + /// + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor BackgroundFilter(Action configure) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = configure; + return Self; + } + + /// + /// Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score. + /// + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Terms to exclude. + /// + public SignificantTermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Mechanism by which the aggregation should be executed: using field values directly or using global ordinals. + /// + public SignificantTermsAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant terms. + /// + public SignificantTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant terms. + /// + public SignificantTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant terms. + /// + public SignificantTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Terms to include. + /// + public SignificantTermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only return terms that are found in more than `min_doc_count` hits. + /// + public SignificantTermsAggregationDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. + /// + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + /// + /// A simple calculation of the number of documents in the foreground sample with a term divided by the number of documents in the background with the term. + /// + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// Can be used to control the volumes of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public SignificantTermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("significant_terms"); + writer.WriteStartObject(); + if (BackgroundFilterDescriptor is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, BackgroundFilterDescriptor, options); + } + else if (BackgroundFilterDescriptorAction is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + } + else if (BackgroundFilterValue is not null) + { + writer.WritePropertyName("background_filter"); + JsonSerializer.Serialize(writer, BackgroundFilterValue, options); + } + + if (ChiSquareDescriptor is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, ChiSquareDescriptor, options); + } + else if (ChiSquareDescriptorAction is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + } + else if (ChiSquareValue is not null) + { + writer.WritePropertyName("chi_square"); + JsonSerializer.Serialize(writer, ChiSquareValue, options); + } + + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (GndDescriptor is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, GndDescriptor, options); + } + else if (GndDescriptorAction is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + } + else if (GndValue is not null) + { + writer.WritePropertyName("gnd"); + JsonSerializer.Serialize(writer, GndValue, options); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (JlhDescriptor is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhDescriptor, options); + } + else if (JlhDescriptorAction is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MutualInformationDescriptor is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationDescriptor, options); + } + else if (MutualInformationDescriptorAction is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (PercentageDescriptor is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, PercentageDescriptor, options); + } + else if (PercentageDescriptorAction is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + } + else if (PercentageValue is not null) + { + writer.WritePropertyName("percentage"); + JsonSerializer.Serialize(writer, PercentageValue, options); + } + + if (ScriptHeuristicDescriptor is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, ScriptHeuristicDescriptor, options); + } + else if (ScriptHeuristicDescriptorAction is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + } + else if (ScriptHeuristicValue is not null) + { + writer.WritePropertyName("script_heuristic"); + JsonSerializer.Serialize(writer, ScriptHeuristicValue, options); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs new file mode 100644 index 00000000000..3746c1be2cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class SimpleValueAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs new file mode 100644 index 00000000000..a20d40dca76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class StandardDeviationBounds +{ + [JsonInclude, JsonPropertyName("lower")] + public double? Lower { get; init; } + [JsonInclude, JsonPropertyName("lower_population")] + public double? LowerPopulation { get; init; } + [JsonInclude, JsonPropertyName("lower_sampling")] + public double? LowerSampling { get; init; } + [JsonInclude, JsonPropertyName("upper")] + public double? Upper { get; init; } + [JsonInclude, JsonPropertyName("upper_population")] + public double? UpperPopulation { get; init; } + [JsonInclude, JsonPropertyName("upper_sampling")] + public double? UpperSampling { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs new file mode 100644 index 00000000000..1dfe7f7db77 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class StandardDeviationBoundsAsString +{ + [JsonInclude, JsonPropertyName("lower")] + public string Lower { get; init; } + [JsonInclude, JsonPropertyName("lower_population")] + public string LowerPopulation { get; init; } + [JsonInclude, JsonPropertyName("lower_sampling")] + public string LowerSampling { get; init; } + [JsonInclude, JsonPropertyName("upper")] + public string Upper { get; init; } + [JsonInclude, JsonPropertyName("upper_population")] + public string UpperPopulation { get; init; } + [JsonInclude, JsonPropertyName("upper_sampling")] + public string UpperSampling { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregate.g.cs new file mode 100644 index 00000000000..a8c8c66d214 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregate.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Statistics aggregation result. `min`, `max` and `avg` are missing if there were no values to process
(`count` is zero).
+///
+public sealed partial class StatsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("avg")] + public double? Avg { get; init; } + [JsonInclude, JsonPropertyName("avg_as_string")] + public string? AvgAsString { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double? Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double? Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public double Sum { get; init; } + [JsonInclude, JsonPropertyName("sum_as_string")] + public string? SumAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs new file mode 100644 index 00000000000..c8dbb72039a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class StatsAggregationConverter : JsonConverter +{ + public override StatsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "stats") + throw new JsonException("Unexpected JSON detected."); + var agg = new StatsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, StatsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("stats"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(StatsAggregationConverter))] +public sealed partial class StatsAggregation : SearchAggregation +{ + public StatsAggregation(string name, Field field) : this(name) => Field = field; + public StatsAggregation(string name) => Name = name; + + internal StatsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class StatsAggregationDescriptor : SerializableDescriptor> +{ + internal StatsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public StatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public StatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StatsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public StatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class StatsAggregationDescriptor : SerializableDescriptor +{ + internal StatsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public StatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public StatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StatsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public StatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs new file mode 100644 index 00000000000..fa25df9afbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class StatsBucketAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("avg")] + public double? Avg { get; init; } + [JsonInclude, JsonPropertyName("avg_as_string")] + public string? AvgAsString { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double? Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double? Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public double Sum { get; init; } + [JsonInclude, JsonPropertyName("sum_as_string")] + public string? SumAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs new file mode 100644 index 00000000000..9c69494b754 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class StatsBucketAggregationConverter : JsonConverter +{ + public override StatsBucketAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "stats_bucket") + throw new JsonException("Unexpected JSON detected."); + var agg = new StatsBucketAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets_path")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.BucketsPath = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("gap_policy")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.GapPolicy = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, StatsBucketAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("stats_bucket"); + writer.WriteStartObject(); + if (value.BucketsPath is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, value.BucketsPath, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.GapPolicy is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, value.GapPolicy, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(StatsBucketAggregationConverter))] +public sealed partial class StatsBucketAggregation : SearchAggregation +{ + public StatsBucketAggregation(string name) => Name = name; + + internal StatsBucketAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } +} + +public sealed partial class StatsBucketAggregationDescriptor : SerializableDescriptor +{ + internal StatsBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public StatsBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + + public StatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + public StatsBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public StatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public StatsBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("stats_bucket"); + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (GapPolicyValue is not null) + { + writer.WritePropertyName("gap_policy"); + JsonSerializer.Serialize(writer, GapPolicyValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs new file mode 100644 index 00000000000..fd301b335c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of the `rare_terms` aggregation when the field is a string. +/// +public sealed partial class StringRareTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs new file mode 100644 index 00000000000..e9b746527a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(StringRareTermsBucketConverter))] +public sealed partial class StringRareTermsBucket : AggregateDictionary +{ + public StringRareTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public string Key { get; init; } +} + +internal sealed class StringRareTermsBucketConverter : JsonConverter +{ + public override StringRareTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + string key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new StringRareTermsBucket(subAggs) { DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, StringRareTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregate.g.cs new file mode 100644 index 00000000000..8fe673d457a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregate.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class StringStatsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("avg_length")] + public double? AvgLength { get; init; } + [JsonInclude, JsonPropertyName("avg_length_as_string")] + public string? AvgLengthAsString { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("distribution")] + public IReadOnlyDictionary? Distribution { get; init; } + [JsonInclude, JsonPropertyName("entropy")] + public double? Entropy { get; init; } + [JsonInclude, JsonPropertyName("max_length")] + public int? MaxLength { get; init; } + [JsonInclude, JsonPropertyName("max_length_as_string")] + public string? MaxLengthAsString { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("min_length")] + public int? MinLength { get; init; } + [JsonInclude, JsonPropertyName("min_length_as_string")] + public string? MinLengthAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs new file mode 100644 index 00000000000..d17fcd718b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs @@ -0,0 +1,367 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class StringStatsAggregationConverter : JsonConverter +{ + public override StringStatsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "string_stats") + throw new JsonException("Unexpected JSON detected."); + var agg = new StringStatsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("show_distribution")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShowDistribution = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, StringStatsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("string_stats"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.ShowDistribution.HasValue) + { + writer.WritePropertyName("show_distribution"); + writer.WriteBooleanValue(value.ShowDistribution.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(StringStatsAggregationConverter))] +public sealed partial class StringStatsAggregation : SearchAggregation +{ + public StringStatsAggregation(string name, Field field) : this(name) => Field = field; + public StringStatsAggregation(string name) => Name = name; + + internal StringStatsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Shows the probability distribution for all characters. + /// + public bool? ShowDistribution { get; set; } +} + +public sealed partial class StringStatsAggregationDescriptor : SerializableDescriptor> +{ + internal StringStatsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public StringStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private bool? ShowDistributionValue { get; set; } + + public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public StringStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StringStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public StringStatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public StringStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Shows the probability distribution for all characters. + /// + public StringStatsAggregationDescriptor ShowDistribution(bool? showDistribution = true) + { + ShowDistributionValue = showDistribution; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("string_stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShowDistributionValue.HasValue) + { + writer.WritePropertyName("show_distribution"); + writer.WriteBooleanValue(ShowDistributionValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class StringStatsAggregationDescriptor : SerializableDescriptor +{ + internal StringStatsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public StringStatsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private bool? ShowDistributionValue { get; set; } + + public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public StringStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StringStatsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public StringStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public StringStatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public StringStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Shows the probability distribution for all characters. + /// + public StringStatsAggregationDescriptor ShowDistribution(bool? showDistribution = true) + { + ShowDistributionValue = showDistribution; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("string_stats"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShowDistributionValue.HasValue) + { + writer.WritePropertyName("show_distribution"); + writer.WriteBooleanValue(ShowDistributionValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsAggregate.g.cs new file mode 100644 index 00000000000..08b2070fa46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsAggregate.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Result of a `terms` aggregation when the field is a string. +/// +public sealed partial class StringTermsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error_upper_bound")] + public long? DocCountErrorUpperBound { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("sum_other_doc_count")] + public long? SumOtherDocCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs new file mode 100644 index 00000000000..52cbe1f7714 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(StringTermsBucketConverter))] +public sealed partial class StringTermsBucket : AggregateDictionary +{ + public StringTermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("doc_count_error")] + public long? DocCountError { get; init; } + [JsonInclude, JsonPropertyName("key")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue Key { get; init; } +} + +internal sealed class StringTermsBucketConverter : JsonConverter +{ + public override StringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + long? docCountError = default; + Elastic.Clients.Elasticsearch.Serverless.FieldValue key = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("doc_count_error", StringComparison.Ordinal)) + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new StringTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, StringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs new file mode 100644 index 00000000000..abc8dc2f9ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Sum aggregation result. `value` is always present and is zero if there were no values to process. +/// +public sealed partial class SumAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs new file mode 100644 index 00000000000..2a181e1b7ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class SumAggregationConverter : JsonConverter +{ + public override SumAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "sum") + throw new JsonException("Unexpected JSON detected."); + var agg = new SumAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, SumAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("sum"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SumAggregationConverter))] +public sealed partial class SumAggregation : SearchAggregation +{ + public SumAggregation(string name, Field field) : this(name) => Field = field; + public SumAggregation(string name) => Name = name; + + internal SumAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class SumAggregationDescriptor : SerializableDescriptor> +{ + internal SumAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public SumAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public SumAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SumAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SumAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sum"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SumAggregationDescriptor : SerializableDescriptor +{ + internal SumAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SumAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public SumAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SumAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SumAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SumAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sum"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigest.g.cs new file mode 100644 index 00000000000..e726728e480 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigest.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TDigest +{ + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + [JsonInclude, JsonPropertyName("compression")] + public int? Compression { get; set; } +} + +public sealed partial class TDigestDescriptor : SerializableDescriptor +{ + internal TDigestDescriptor(Action configure) => configure.Invoke(this); + + public TDigestDescriptor() : base() + { + } + + private int? CompressionValue { get; set; } + + /// + /// Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. + /// + public TDigestDescriptor Compression(int? compression) + { + CompressionValue = compression; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CompressionValue.HasValue) + { + writer.WritePropertyName("compression"); + writer.WriteNumberValue(CompressionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs new file mode 100644 index 00000000000..f17b90e7338 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TDigestPercentileRanksAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.Percentiles Values { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs new file mode 100644 index 00000000000..bd47ae63781 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TDigestPercentilesAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.Percentiles Values { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregate.g.cs new file mode 100644 index 00000000000..d2c7657b542 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregate.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TTestAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs new file mode 100644 index 00000000000..1feb96b6aec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs @@ -0,0 +1,442 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class TTestAggregationConverter : JsonConverter +{ + public override TTestAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "t_test") + throw new JsonException("Unexpected JSON detected."); + var agg = new TTestAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("a")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.a = value; + } + + continue; + } + + if (reader.ValueTextEquals("b")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.b = value; + } + + continue; + } + + if (reader.ValueTextEquals("type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Type = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, TTestAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("t_test"); + writer.WriteStartObject(); + if (value.a is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, value.a, options); + } + + if (value.b is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, value.b, options); + } + + if (value.Type is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, value.Type, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TTestAggregationConverter))] +public sealed partial class TTestAggregation : SearchAggregation +{ + public TTestAggregation(string name) => Name = name; + + internal TTestAggregation() + { + } + + /// + /// Test population A. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? a { get; set; } + + /// + /// Test population B. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? b { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The type of test. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? Type { get; set; } +} + +public sealed partial class TTestAggregationDescriptor : SerializableDescriptor> +{ + internal TTestAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public TTestAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? aValue { get; set; } + private TestPopulationDescriptor aDescriptor { get; set; } + private Action> aDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? bValue { get; set; } + private TestPopulationDescriptor bDescriptor { get; set; } + private Action> bDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? TypeValue { get; set; } + + /// + /// Test population A. + /// + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? a) + { + aDescriptor = null; + aDescriptorAction = null; + aValue = a; + return Self; + } + + public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + { + aValue = null; + aDescriptorAction = null; + aDescriptor = descriptor; + return Self; + } + + public TTestAggregationDescriptor a(Action> configure) + { + aValue = null; + aDescriptor = null; + aDescriptorAction = configure; + return Self; + } + + /// + /// Test population B. + /// + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? b) + { + bDescriptor = null; + bDescriptorAction = null; + bValue = b; + return Self; + } + + public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + { + bValue = null; + bDescriptorAction = null; + bDescriptor = descriptor; + return Self; + } + + public TTestAggregationDescriptor b(Action> configure) + { + bValue = null; + bDescriptor = null; + bDescriptorAction = configure; + return Self; + } + + public TTestAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The type of test. + /// + public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("t_test"); + writer.WriteStartObject(); + if (aDescriptor is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, aDescriptor, options); + } + else if (aDescriptorAction is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + } + else if (aValue is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, aValue, options); + } + + if (bDescriptor is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, bDescriptor, options); + } + else if (bDescriptorAction is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + } + else if (bValue is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, bValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TTestAggregationDescriptor : SerializableDescriptor +{ + internal TTestAggregationDescriptor(Action configure) => configure.Invoke(this); + + public TTestAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? aValue { get; set; } + private TestPopulationDescriptor aDescriptor { get; set; } + private Action aDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? bValue { get; set; } + private TestPopulationDescriptor bDescriptor { get; set; } + private Action bDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? TypeValue { get; set; } + + /// + /// Test population A. + /// + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? a) + { + aDescriptor = null; + aDescriptorAction = null; + aValue = a; + return Self; + } + + public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + { + aValue = null; + aDescriptorAction = null; + aDescriptor = descriptor; + return Self; + } + + public TTestAggregationDescriptor a(Action configure) + { + aValue = null; + aDescriptor = null; + aDescriptorAction = configure; + return Self; + } + + /// + /// Test population B. + /// + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? b) + { + bDescriptor = null; + bDescriptorAction = null; + bValue = b; + return Self; + } + + public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + { + bValue = null; + bDescriptorAction = null; + bDescriptor = descriptor; + return Self; + } + + public TTestAggregationDescriptor b(Action configure) + { + bValue = null; + bDescriptor = null; + bDescriptorAction = configure; + return Self; + } + + public TTestAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The type of test. + /// + public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("t_test"); + writer.WriteStartObject(); + if (aDescriptor is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, aDescriptor, options); + } + else if (aDescriptorAction is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + } + else if (aValue is not null) + { + writer.WritePropertyName("a"); + JsonSerializer.Serialize(writer, aValue, options); + } + + if (bDescriptor is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, bDescriptor, options); + } + else if (bDescriptorAction is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + } + else if (bValue is not null) + { + writer.WritePropertyName("b"); + JsonSerializer.Serialize(writer, bValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs new file mode 100644 index 00000000000..2092928970c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -0,0 +1,1129 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class TermsAggregationConverter : JsonConverter +{ + public override TermsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "terms") + throw new JsonException("Unexpected JSON detected."); + var agg = new TermsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("collect_mode")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.CollectMode = value; + } + + continue; + } + + if (reader.ValueTextEquals("exclude")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Exclude = value; + } + + continue; + } + + if (reader.ValueTextEquals("execution_hint")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ExecutionHint = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("include")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Include = value; + } + + continue; + } + + if (reader.ValueTextEquals("min_doc_count")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MinDocCount = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing_bucket")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MissingBucket = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing_order")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.MissingOrder = value; + } + + continue; + } + + if (reader.ValueTextEquals("order")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Order = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + + if (reader.ValueTextEquals("show_term_doc_count_error")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShowTermDocCountError = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("value_type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ValueType = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + + if (reader.ValueTextEquals("aggs") || reader.ValueTextEquals("aggregations")) + { + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Aggregations = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, TermsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("terms"); + writer.WriteStartObject(); + if (value.CollectMode is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, value.CollectMode, options); + } + + if (value.Exclude is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, value.Exclude, options); + } + + if (value.ExecutionHint is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, value.ExecutionHint, options); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Include is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, value.Include, options); + } + + if (value.MinDocCount.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(value.MinDocCount.Value); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.MissingBucket.HasValue) + { + writer.WritePropertyName("missing_bucket"); + writer.WriteBooleanValue(value.MissingBucket.Value); + } + + if (value.MissingOrder is not null) + { + writer.WritePropertyName("missing_order"); + JsonSerializer.Serialize(writer, value.MissingOrder, options); + } + + if (value.Order is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(value.Order, writer, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + if (value.ShowTermDocCountError.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(value.ShowTermDocCountError.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (!string.IsNullOrEmpty(value.ValueType)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(value.ValueType); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TermsAggregationConverter))] +public sealed partial class TermsAggregation : SearchAggregation +{ + public TermsAggregation(string name) => Name = name; + + internal TermsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + + /// + /// Determines how child aggregations should be calculated: breadth-first or depth-first. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } + + /// + /// Values to exclude.
Accepts regular expressions and partitions.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } + + /// + /// The field from which to return terms. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + + /// + /// Values to include.
Accepts regular expressions and partitions.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// Only return values that are found in more than `min_doc_count` hits. + /// + public int? MinDocCount { get; set; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public FieldValue? Missing { get; set; } + public bool? MissingBucket { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } + override public string? Name { get; internal set; } + [JsonConverter(typeof(AggregateOrderConverter))] + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public ICollection>? Order { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public int? ShardSize { get; set; } + + /// + /// Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard. + /// + public bool? ShowTermDocCountError { get; set; } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public int? Size { get; set; } + + /// + /// Coerced unmapped fields into the specified type. + /// + public string? ValueType { get; set; } +} + +public sealed partial class TermsAggregationDescriptor : SerializableDescriptor> +{ + internal TermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public TermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private FieldValue? MissingValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private ICollection>? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? ShardSizeValue { get; set; } + private bool? ShowTermDocCountErrorValue { get; set; } + private int? SizeValue { get; set; } + private string? ValueTypeValue { get; set; } + + public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public TermsAggregationDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Determines how child aggregations should be calculated: breadth-first or depth-first. + /// + public TermsAggregationDescriptor CollectMode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? collectMode) + { + CollectModeValue = collectMode; + return Self; + } + + /// + /// Values to exclude.
Accepts regular expressions and partitions.
+ ///
+ public TermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + public TermsAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return terms. + /// + public TermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return terms. + /// + public TermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Values to include.
Accepts regular expressions and partitions.
+ ///
+ public TermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + public TermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only return values that are found in more than `min_doc_count` hits. + /// + public TermsAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public TermsAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public TermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard. + /// + public TermsAggregationDescriptor ShowTermDocCountError(bool? showTermDocCountError = true) + { + ShowTermDocCountErrorValue = showTermDocCountError; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public TermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Coerced unmapped fields into the specified type. + /// + public TermsAggregationDescriptor ValueType(string? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("terms"); + writer.WriteStartObject(); + if (CollectModeValue is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, CollectModeValue, options); + } + + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (MissingBucketValue.HasValue) + { + writer.WritePropertyName("missing_bucket"); + writer.WriteBooleanValue(MissingBucketValue.Value); + } + + if (MissingOrderValue is not null) + { + writer.WritePropertyName("missing_order"); + JsonSerializer.Serialize(writer, MissingOrderValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (ShowTermDocCountErrorValue.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(ShowTermDocCountErrorValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (!string.IsNullOrEmpty(ValueTypeValue)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(ValueTypeValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TermsAggregationDescriptor : SerializableDescriptor +{ + internal TermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public TermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? IncludeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private FieldValue? MissingValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private ICollection>? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? ShardSizeValue { get; set; } + private bool? ShowTermDocCountErrorValue { get; set; } + private int? SizeValue { get; set; } + private string? ValueTypeValue { get; set; } + + public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public TermsAggregationDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + /// + /// Determines how child aggregations should be calculated: breadth-first or depth-first. + /// + public TermsAggregationDescriptor CollectMode(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? collectMode) + { + CollectModeValue = collectMode; + return Self; + } + + /// + /// Values to exclude.
Accepts regular expressions and partitions.
+ ///
+ public TermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + public TermsAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return terms. + /// + public TermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return terms. + /// + public TermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return terms. + /// + public TermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Values to include.
Accepts regular expressions and partitions.
+ ///
+ public TermsAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + public TermsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Only return values that are found in more than `min_doc_count` hits. + /// + public TermsAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + /// + /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
+ ///
+ public TermsAggregationDescriptor Order(ICollection>? order) + { + OrderValue = order; + return Self; + } + + public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
+ ///
+ public TermsAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard. + /// + public TermsAggregationDescriptor ShowTermDocCountError(bool? showTermDocCountError = true) + { + ShowTermDocCountErrorValue = showTermDocCountError; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public TermsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Coerced unmapped fields into the specified type. + /// + public TermsAggregationDescriptor ValueType(string? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("terms"); + writer.WriteStartObject(); + if (CollectModeValue is not null) + { + writer.WritePropertyName("collect_mode"); + JsonSerializer.Serialize(writer, CollectModeValue, options); + } + + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (ExecutionHintValue is not null) + { + writer.WritePropertyName("execution_hint"); + JsonSerializer.Serialize(writer, ExecutionHintValue, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (MissingBucketValue.HasValue) + { + writer.WritePropertyName("missing_bucket"); + writer.WriteBooleanValue(MissingBucketValue.Value); + } + + if (MissingOrderValue is not null) + { + writer.WritePropertyName("missing_order"); + JsonSerializer.Serialize(writer, MissingOrderValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (ShowTermDocCountErrorValue.HasValue) + { + writer.WritePropertyName("show_term_doc_count_error"); + writer.WriteBooleanValue(ShowTermDocCountErrorValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (!string.IsNullOrEmpty(ValueTypeValue)) + { + writer.WritePropertyName("value_type"); + writer.WriteStringValue(ValueTypeValue); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs new file mode 100644 index 00000000000..b9ff478246b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TermsPartition +{ + /// + /// The number of partitions. + /// + [JsonInclude, JsonPropertyName("num_partitions")] + public long NumPartitions { get; set; } + + /// + /// The partition number for this request. + /// + [JsonInclude, JsonPropertyName("partition")] + public long Partition { get; set; } +} + +public sealed partial class TermsPartitionDescriptor : SerializableDescriptor +{ + internal TermsPartitionDescriptor(Action configure) => configure.Invoke(this); + + public TermsPartitionDescriptor() : base() + { + } + + private long NumPartitionsValue { get; set; } + private long PartitionValue { get; set; } + + /// + /// The number of partitions. + /// + public TermsPartitionDescriptor NumPartitions(long numPartitions) + { + NumPartitionsValue = numPartitions; + return Self; + } + + /// + /// The partition number for this request. + /// + public TermsPartitionDescriptor Partition(long partition) + { + PartitionValue = partition; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("num_partitions"); + writer.WriteNumberValue(NumPartitionsValue); + writer.WritePropertyName("partition"); + writer.WriteNumberValue(PartitionValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs new file mode 100644 index 00000000000..f4108bb18cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs @@ -0,0 +1,246 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TestPopulation +{ + /// + /// The field to aggregate. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// A filter used to define a set of records to run unpaired t-test on. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class TestPopulationDescriptor : SerializableDescriptor> +{ + internal TestPopulationDescriptor(Action> configure) => configure.Invoke(this); + + public TestPopulationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// A filter used to define a set of records to run unpaired t-test on. + /// + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TestPopulationDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TestPopulationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TestPopulationDescriptor : SerializableDescriptor +{ + internal TestPopulationDescriptor(Action configure) => configure.Invoke(this); + + public TestPopulationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// A filter used to define a set of records to run unpaired t-test on. + /// + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TestPopulationDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TestPopulationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregate.g.cs new file mode 100644 index 00000000000..661c3246f20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TopHitsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata Hits { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs new file mode 100644 index 00000000000..cac4c975dd0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -0,0 +1,1143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class TopHitsAggregationConverter : JsonConverter +{ + public override TopHitsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "top_hits") + throw new JsonException("Unexpected JSON detected."); + var agg = new TopHitsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("_source")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Source = value; + } + + continue; + } + + if (reader.ValueTextEquals("docvalue_fields")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.DocvalueFields = value; + } + + continue; + } + + if (reader.ValueTextEquals("explain")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Explain = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("from")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.From = value; + } + + continue; + } + + if (reader.ValueTextEquals("highlight")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Highlight = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("script_fields")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.ScriptFields = value; + } + + continue; + } + + if (reader.ValueTextEquals("seq_no_primary_term")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.SeqNoPrimaryTerm = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("sort")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize(ref reader, options); + if (value is not null) + { + agg.Sort = value; + } + + continue; + } + + if (reader.ValueTextEquals("stored_fields")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.StoredFields = value; + } + + continue; + } + + if (reader.ValueTextEquals("track_scores")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.TrackScores = value; + } + + continue; + } + + if (reader.ValueTextEquals("version")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Version = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, TopHitsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_hits"); + writer.WriteStartObject(); + if (value.Source is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, value.Source, options); + } + + if (value.DocvalueFields is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, value.DocvalueFields, options); + } + + if (value.Explain.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(value.Explain.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.ScriptFields is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, value.ScriptFields, options); + } + + if (value.SeqNoPrimaryTerm.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(value.Sort, writer, options); + } + + if (value.StoredFields is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, value.StoredFields, options); + } + + if (value.TrackScores.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(value.TrackScores.Value); + } + + if (value.Version.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(value.Version.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TopHitsAggregationConverter))] +public sealed partial class TopHitsAggregation : SearchAggregation +{ + public TopHitsAggregation(string name, Field field) : this(name) => Field = field; + public TopHitsAggregation(string name) => Name = name; + + internal TopHitsAggregation() + { + } + + /// + /// Selects the fields of the source that are returned. + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + + /// + /// Fields for which to return doc values. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFields { get; set; } + + /// + /// If `true`, returns detailed information about score computation as part of a hit. + /// + public bool? Explain { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Starting document offset. + /// + public int? From { get; set; } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. + /// + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// Returns the result of one or more script evaluations for each hit. + /// + public IDictionary? ScriptFields { get; set; } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + public bool? SeqNoPrimaryTerm { get; set; } + + /// + /// The maximum number of top matching hits to return per bucket. + /// + public int? Size { get; set; } + + /// + /// Sort order of the top matching hits.
By default, the hits are sorted by the score of the main query.
+ ///
+ public ICollection? Sort { get; set; } + + /// + /// Returns values for the specified stored fields (fields that use the `store` mapping option). + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } + + /// + /// If `true`, calculates and returns document scores, even if the scores are not used for sorting. + /// + public bool? TrackScores { get; set; } + + /// + /// If `true`, returns document version as part of a hit. + /// + public bool? Version { get; set; } +} + +public sealed partial class TopHitsAggregationDescriptor : SerializableDescriptor> +{ + internal TopHitsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public TopHitsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFieldsValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? FromValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private bool? TrackScoresValue { get; set; } + private bool? VersionValue { get; set; } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. + /// + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Highlight(Action> configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Sort order of the top matching hits.
By default, the hits are sorted by the score of the main query.
+ ///
+ public TopHitsAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public TopHitsAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Selects the fields of the source that are returned. + /// + public TopHitsAggregationDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// Fields for which to return doc values. + /// + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.Fields? docvalueFields) + { + DocvalueFieldsValue = docvalueFields; + return Self; + } + + /// + /// If `true`, returns detailed information about score computation as part of a hit. + /// + public TopHitsAggregationDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public TopHitsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Starting document offset. + /// + public TopHitsAggregationDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + public TopHitsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TopHitsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Returns the result of one or more script evaluations for each hit. + /// + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + public TopHitsAggregationDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The maximum number of top matching hits to return per bucket. + /// + public TopHitsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Returns values for the specified stored fields (fields that use the `store` mapping option). + /// + public TopHitsAggregationDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + /// + /// If `true`, calculates and returns document scores, even if the scores are not used for sorting. + /// + public TopHitsAggregationDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// If `true`, returns document version as part of a hit. + /// + public TopHitsAggregationDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_hits"); + writer.WriteStartObject(); + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TopHitsAggregationDescriptor : SerializableDescriptor +{ + internal TopHitsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public TopHitsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFieldsValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? FromValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private bool? TrackScoresValue { get; set; } + private bool? VersionValue { get; set; } + + /// + /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. + /// + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Sort order of the top matching hits.
By default, the hits are sorted by the score of the main query.
+ ///
+ public TopHitsAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public TopHitsAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Selects the fields of the source that are returned. + /// + public TopHitsAggregationDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// Fields for which to return doc values. + /// + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.Fields? docvalueFields) + { + DocvalueFieldsValue = docvalueFields; + return Self; + } + + /// + /// If `true`, returns detailed information about score computation as part of a hit. + /// + public TopHitsAggregationDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public TopHitsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TopHitsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Starting document offset. + /// + public TopHitsAggregationDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + public TopHitsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TopHitsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// Returns the result of one or more script evaluations for each hit. + /// + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If `true`, returns sequence number and primary term of the last modification of each hit. + /// + public TopHitsAggregationDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The maximum number of top matching hits to return per bucket. + /// + public TopHitsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Returns values for the specified stored fields (fields that use the `store` mapping option). + /// + public TopHitsAggregationDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + /// + /// If `true`, calculates and returns document scores, even if the scores are not used for sorting. + /// + public TopHitsAggregationDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// If `true`, returns document version as part of a hit. + /// + public TopHitsAggregationDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_hits"); + writer.WriteStartObject(); + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs new file mode 100644 index 00000000000..2b7e43bd16c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TopMetrics +{ + [JsonInclude, JsonPropertyName("metrics")] + public IReadOnlyDictionary? Metrics { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public IReadOnlyCollection? Sort { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs new file mode 100644 index 00000000000..196c66f7a93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TopMetricsAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("top")] + public IReadOnlyCollection Top { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs new file mode 100644 index 00000000000..3d6072088bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs @@ -0,0 +1,701 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class TopMetricsAggregationConverter : JsonConverter +{ + public override TopMetricsAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "top_metrics") + throw new JsonException("Unexpected JSON detected."); + var agg = new TopMetricsAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("metrics")) + { + reader.Read(); + var value = JsonSerializer.Deserialize?>(ref reader, options); + if (value is not null) + { + agg.Metrics = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + + if (reader.ValueTextEquals("size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Size = value; + } + + continue; + } + + if (reader.ValueTextEquals("sort")) + { + reader.Read(); + var value = SingleOrManySerializationHelper.Deserialize(ref reader, options); + if (value is not null) + { + agg.Sort = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, TopMetricsAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_metrics"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.Metrics is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, value.Metrics, options); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(value.Sort, writer, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TopMetricsAggregationConverter))] +public sealed partial class TopMetricsAggregation : SearchAggregation +{ + public TopMetricsAggregation(string name, Field field) : this(name) => Field = field; + public TopMetricsAggregation(string name) => Name = name; + + internal TopMetricsAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public IDictionary? Meta { get; set; } + + /// + /// The fields of the top document to return. + /// + public ICollection? Metrics { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// The number of top documents from which to return metrics. + /// + public int? Size { get; set; } + + /// + /// The sort order of the documents. + /// + public ICollection? Sort { get; set; } +} + +public sealed partial class TopMetricsAggregationDescriptor : SerializableDescriptor> +{ + internal TopMetricsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public TopMetricsAggregationDescriptor() : base() + { + } + + private ICollection? MetricsValue { get; set; } + private TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action> MetricsDescriptorAction { get; set; } + private Action>[] MetricsDescriptorActions { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The fields of the top document to return. + /// + public TopMetricsAggregationDescriptor Metrics(ICollection? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsValue = metrics; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(TopMetricsValueDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsDescriptor = descriptor; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(Action> configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorActions = null; + MetricsDescriptorAction = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(params Action>[] configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = configure; + return Self; + } + + /// + /// The sort order of the documents. + /// + public TopMetricsAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public TopMetricsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TopMetricsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TopMetricsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of top documents from which to return metrics. + /// + public TopMetricsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_metrics"); + writer.WriteStartObject(); + if (MetricsDescriptor is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsDescriptor, options); + } + else if (MetricsDescriptorAction is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsDescriptorActions is not null) + { + writer.WritePropertyName("metrics"); + if (MetricsDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MetricsDescriptorActions) + { + JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + } + + if (MetricsDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + SingleOrManySerializationHelper.Serialize(MetricsValue, writer, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TopMetricsAggregationDescriptor : SerializableDescriptor +{ + internal TopMetricsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public TopMetricsAggregationDescriptor() : base() + { + } + + private ICollection? MetricsValue { get; set; } + private TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Action[] MetricsDescriptorActions { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The fields of the top document to return. + /// + public TopMetricsAggregationDescriptor Metrics(ICollection? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsValue = metrics; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(TopMetricsValueDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsDescriptor = descriptor; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorActions = null; + MetricsDescriptorAction = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Metrics(params Action[] configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = configure; + return Self; + } + + /// + /// The sort order of the documents. + /// + public TopMetricsAggregationDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public TopMetricsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TopMetricsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TopMetricsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public TopMetricsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// The number of top documents from which to return metrics. + /// + public TopMetricsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("top_metrics"); + writer.WriteStartObject(); + if (MetricsDescriptor is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsDescriptor, options); + } + else if (MetricsDescriptorAction is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsDescriptorActions is not null) + { + writer.WritePropertyName("metrics"); + if (MetricsDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MetricsDescriptorActions) + { + JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + } + + if (MetricsDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + SingleOrManySerializationHelper.Serialize(MetricsValue, writer, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs new file mode 100644 index 00000000000..ac51aa52cd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs @@ -0,0 +1,120 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class TopMetricsValue +{ + /// + /// A field to return as a metric. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } +} + +public sealed partial class TopMetricsValueDescriptor : SerializableDescriptor> +{ + internal TopMetricsValueDescriptor(Action> configure) => configure.Invoke(this); + + public TopMetricsValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// A field to return as a metric. + /// + public TopMetricsValueDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// A field to return as a metric. + /// + public TopMetricsValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TopMetricsValueDescriptor : SerializableDescriptor +{ + internal TopMetricsValueDescriptor(Action configure) => configure.Invoke(this); + + public TopMetricsValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// A field to return as a metric. + /// + public TopMetricsValueDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// A field to return as a metric. + /// + public TopMetricsValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// A field to return as a metric. + /// + public TopMetricsValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs new file mode 100644 index 00000000000..6347e58ef31 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Value count aggregation result. `value` is always present. +/// +public sealed partial class ValueCountAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs new file mode 100644 index 00000000000..eecc78b13dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs @@ -0,0 +1,357 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class ValueCountAggregationConverter : JsonConverter +{ + public override ValueCountAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "value_count") + throw new JsonException("Unexpected JSON detected."); + var agg = new ValueCountAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + + if (reader.ValueTextEquals("script")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Script = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, ValueCountAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("value_count"); + writer.WriteStartObject(); + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + + if (value.Script is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, value.Script, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(ValueCountAggregationConverter))] +public sealed partial class ValueCountAggregation : SearchAggregation +{ + public ValueCountAggregation(string name, Field field) : this(name) => Field = field; + public ValueCountAggregation(string name) => Name = name; + + internal ValueCountAggregation() + { + } + + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + override public string? Name { get; internal set; } + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class ValueCountAggregationDescriptor : SerializableDescriptor> +{ + internal ValueCountAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public ValueCountAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ValueCountAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ValueCountAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ValueCountAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public ValueCountAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("value_count"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ValueCountAggregationDescriptor : SerializableDescriptor +{ + internal ValueCountAggregationDescriptor(Action configure) => configure.Invoke(this); + + public ValueCountAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public ValueCountAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ValueCountAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ValueCountAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ValueCountAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public ValueCountAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("value_count"); + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs new file mode 100644 index 00000000000..4007ed3e8a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class VariableWidthHistogramAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs new file mode 100644 index 00000000000..1be140549a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs @@ -0,0 +1,404 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class VariableWidthHistogramAggregationConverter : JsonConverter +{ + public override VariableWidthHistogramAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "variable_width_histogram") + throw new JsonException("Unexpected JSON detected."); + var agg = new VariableWidthHistogramAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("buckets")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Buckets = value; + } + + continue; + } + + if (reader.ValueTextEquals("field")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Field = value; + } + + continue; + } + + if (reader.ValueTextEquals("initial_buffer")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.InitialBuffer = value; + } + + continue; + } + + if (reader.ValueTextEquals("shard_size")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ShardSize = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, VariableWidthHistogramAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("variable_width_histogram"); + writer.WriteStartObject(); + if (value.Buckets.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(value.Buckets.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (value.InitialBuffer.HasValue) + { + writer.WritePropertyName("initial_buffer"); + writer.WriteNumberValue(value.InitialBuffer.Value); + } + + if (value.ShardSize.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(value.ShardSize.Value); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(VariableWidthHistogramAggregationConverter))] +public sealed partial class VariableWidthHistogramAggregation : SearchAggregation +{ + public VariableWidthHistogramAggregation(string name) => Name = name; + + internal VariableWidthHistogramAggregation() + { + } + + /// + /// The target number of buckets. + /// + public int? Buckets { get; set; } + + /// + /// The name of the field. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.
Defaults to `min(10 * shard_size, 50000)`.
+ ///
+ public int? InitialBuffer { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// The number of buckets that the coordinating node will request from each shard.
Defaults to `buckets * 50`.
+ ///
+ public int? ShardSize { get; set; } +} + +public sealed partial class VariableWidthHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal VariableWidthHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public VariableWidthHistogramAggregationDescriptor() : base() + { + } + + private int? BucketsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? InitialBufferValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? ShardSizeValue { get; set; } + + /// + /// The target number of buckets. + /// + public VariableWidthHistogramAggregationDescriptor Buckets(int? buckets) + { + BucketsValue = buckets; + return Self; + } + + /// + /// The name of the field. + /// + public VariableWidthHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public VariableWidthHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.
Defaults to `min(10 * shard_size, 50000)`.
+ ///
+ public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuffer) + { + InitialBufferValue = initialBuffer; + return Self; + } + + public VariableWidthHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of buckets that the coordinating node will request from each shard.
Defaults to `buckets * 50`.
+ ///
+ public VariableWidthHistogramAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("variable_width_histogram"); + writer.WriteStartObject(); + if (BucketsValue.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(BucketsValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (InitialBufferValue.HasValue) + { + writer.WritePropertyName("initial_buffer"); + writer.WriteNumberValue(InitialBufferValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class VariableWidthHistogramAggregationDescriptor : SerializableDescriptor +{ + internal VariableWidthHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public VariableWidthHistogramAggregationDescriptor() : base() + { + } + + private int? BucketsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private int? InitialBufferValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? ShardSizeValue { get; set; } + + /// + /// The target number of buckets. + /// + public VariableWidthHistogramAggregationDescriptor Buckets(int? buckets) + { + BucketsValue = buckets; + return Self; + } + + /// + /// The name of the field. + /// + public VariableWidthHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public VariableWidthHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field. + /// + public VariableWidthHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.
Defaults to `min(10 * shard_size, 50000)`.
+ ///
+ public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuffer) + { + InitialBufferValue = initialBuffer; + return Self; + } + + public VariableWidthHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The number of buckets that the coordinating node will request from each shard.
Defaults to `buckets * 50`.
+ ///
+ public VariableWidthHistogramAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("variable_width_histogram"); + writer.WriteStartObject(); + if (BucketsValue.HasValue) + { + writer.WritePropertyName("buckets"); + writer.WriteNumberValue(BucketsValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (InitialBufferValue.HasValue) + { + writer.WritePropertyName("initial_buffer"); + writer.WriteNumberValue(InitialBufferValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs new file mode 100644 index 00000000000..85ad253a4b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(VariableWidthHistogramBucketConverter))] +public sealed partial class VariableWidthHistogramBucket : AggregateDictionary +{ + public VariableWidthHistogramBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) + { + } + + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("key")] + public double Key { get; init; } + [JsonInclude, JsonPropertyName("key_as_string")] + public string? KeyAsString { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double Max { get; init; } + [JsonInclude, JsonPropertyName("max_as_string")] + public string? MaxAsString { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double Min { get; init; } + [JsonInclude, JsonPropertyName("min_as_string")] + public string? MinAsString { get; init; } +} + +internal sealed class VariableWidthHistogramBucketConverter : JsonConverter +{ + public override VariableWidthHistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + var subAggs = new Dictionary();// TODO - Optimise this and only create if we need it. + long docCount = default; + double key = default; + string? keyAsString = default; + double max = default; + string? maxAsString = default; + double min = default; + string? minAsString = default; + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + break; + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString();// TODO: Future optimisation, get raw bytes span and parse based on those + reader.Read(); + if (name.Equals("doc_count", StringComparison.Ordinal)) + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("key_as_string", StringComparison.Ordinal)) + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("max", StringComparison.Ordinal)) + { + max = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("max_as_string", StringComparison.Ordinal)) + { + maxAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("min", StringComparison.Ordinal)) + { + min = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Equals("min_as_string", StringComparison.Ordinal)) + { + minAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (name.Contains("#")) + { + AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + + return new VariableWidthHistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString, Max = max, MaxAsString = maxAsString, Min = min, MinAsString = minAsString }; + } + + public override void Write(Utf8JsonWriter writer, VariableWidthHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs new file mode 100644 index 00000000000..b4bee60b073 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +/// +/// Weighted average aggregation result. `value` is missing if the weight was set to zero. +/// +public sealed partial class WeightedAverageAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double? Value { get; init; } + [JsonInclude, JsonPropertyName("value_as_string")] + public string? ValueAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs new file mode 100644 index 00000000000..b2d058f0838 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs @@ -0,0 +1,487 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +internal sealed class WeightedAverageAggregationConverter : JsonConverter +{ + public override WeightedAverageAggregation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var aggName = reader.GetString(); + if (aggName != "weighted_avg") + throw new JsonException("Unexpected JSON detected."); + var agg = new WeightedAverageAggregation(aggName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("format")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Format = value; + } + + continue; + } + + if (reader.ValueTextEquals("value")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Value = value; + } + + continue; + } + + if (reader.ValueTextEquals("value_type")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.ValueType = value; + } + + continue; + } + + if (reader.ValueTextEquals("weight")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Weight = value; + } + + continue; + } + } + } + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals("meta")) + { + var value = JsonSerializer.Deserialize>(ref reader, options); + if (value is not null) + { + agg.Meta = value; + } + + continue; + } + } + } + + return agg; + } + + public override void Write(Utf8JsonWriter writer, WeightedAverageAggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("weighted_avg"); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.Value is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + } + + if (value.ValueType is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, value.ValueType, options); + } + + if (value.Weight is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, value.Weight, options); + } + + writer.WriteEndObject(); + if (value.Meta is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(WeightedAverageAggregationConverter))] +public sealed partial class WeightedAverageAggregation : SearchAggregation +{ + public WeightedAverageAggregation(string name) => Name = name; + + internal WeightedAverageAggregation() + { + } + + /// + /// A numeric response formatter. + /// + public string? Format { get; set; } + public IDictionary? Meta { get; set; } + override public string? Name { get; internal set; } + + /// + /// Configuration for the field that provides the values. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } + + /// + /// Configuration for the field or script that provides the weights. + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? Weight { get; set; } +} + +public sealed partial class WeightedAverageAggregationDescriptor : SerializableDescriptor> +{ + internal WeightedAverageAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public WeightedAverageAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? ValueValue { get; set; } + private WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action> ValueDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? WeightValue { get; set; } + private WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action> WeightDescriptorAction { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Configuration for the field that provides the values. + /// + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? value) + { + ValueDescriptor = null; + ValueDescriptorAction = null; + ValueValue = value; + return Self; + } + + public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + { + ValueValue = null; + ValueDescriptorAction = null; + ValueDescriptor = descriptor; + return Self; + } + + public WeightedAverageAggregationDescriptor Value(Action> configure) + { + ValueValue = null; + ValueDescriptor = null; + ValueDescriptorAction = configure; + return Self; + } + + /// + /// Configuration for the field or script that provides the weights. + /// + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? weight) + { + WeightDescriptor = null; + WeightDescriptorAction = null; + WeightValue = weight; + return Self; + } + + public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + { + WeightValue = null; + WeightDescriptorAction = null; + WeightDescriptor = descriptor; + return Self; + } + + public WeightedAverageAggregationDescriptor Weight(Action> configure) + { + WeightValue = null; + WeightDescriptor = null; + WeightDescriptorAction = configure; + return Self; + } + + /// + /// A numeric response formatter. + /// + public WeightedAverageAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public WeightedAverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public WeightedAverageAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("weighted_avg"); + writer.WriteStartObject(); + if (ValueDescriptor is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueDescriptor, options); + } + else if (ValueDescriptorAction is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(ValueDescriptorAction), options); + } + else if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + if (WeightDescriptor is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, WeightDescriptor, options); + } + else if (WeightDescriptorAction is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(WeightDescriptorAction), options); + } + else if (WeightValue is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, WeightValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class WeightedAverageAggregationDescriptor : SerializableDescriptor +{ + internal WeightedAverageAggregationDescriptor(Action configure) => configure.Invoke(this); + + public WeightedAverageAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? ValueValue { get; set; } + private WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action ValueDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? WeightValue { get; set; } + private WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action WeightDescriptorAction { get; set; } + private string? FormatValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Configuration for the field that provides the values. + /// + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? value) + { + ValueDescriptor = null; + ValueDescriptorAction = null; + ValueValue = value; + return Self; + } + + public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + { + ValueValue = null; + ValueDescriptorAction = null; + ValueDescriptor = descriptor; + return Self; + } + + public WeightedAverageAggregationDescriptor Value(Action configure) + { + ValueValue = null; + ValueDescriptor = null; + ValueDescriptorAction = configure; + return Self; + } + + /// + /// Configuration for the field or script that provides the weights. + /// + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? weight) + { + WeightDescriptor = null; + WeightDescriptorAction = null; + WeightValue = weight; + return Self; + } + + public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + { + WeightValue = null; + WeightDescriptorAction = null; + WeightDescriptor = descriptor; + return Self; + } + + public WeightedAverageAggregationDescriptor Weight(Action configure) + { + WeightValue = null; + WeightDescriptor = null; + WeightDescriptorAction = configure; + return Self; + } + + /// + /// A numeric response formatter. + /// + public WeightedAverageAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public WeightedAverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public WeightedAverageAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("weighted_avg"); + writer.WriteStartObject(); + if (ValueDescriptor is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueDescriptor, options); + } + else if (ValueDescriptorAction is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(ValueDescriptorAction), options); + } + else if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + if (WeightDescriptor is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, WeightDescriptor, options); + } + else if (WeightDescriptorAction is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(WeightDescriptorAction), options); + } + else if (WeightValue is not null) + { + writer.WritePropertyName("weight"); + JsonSerializer.Serialize(writer, WeightValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageValue.g.cs new file mode 100644 index 00000000000..52db3530f74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageValue.g.cs @@ -0,0 +1,194 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +public sealed partial class WeightedAverageValue +{ + /// + /// The field from which to extract the values or weights. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// A value or weight to use if the field is missing. + /// + [JsonInclude, JsonPropertyName("missing")] + public double? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } +} + +public sealed partial class WeightedAverageValueDescriptor : SerializableDescriptor> +{ + internal WeightedAverageValueDescriptor(Action> configure) => configure.Invoke(this); + + public WeightedAverageValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private double? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// The field from which to extract the values or weights. + /// + public WeightedAverageValueDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to extract the values or weights. + /// + public WeightedAverageValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// A value or weight to use if the field is missing. + /// + public WeightedAverageValueDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + public WeightedAverageValueDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class WeightedAverageValueDescriptor : SerializableDescriptor +{ + internal WeightedAverageValueDescriptor(Action configure) => configure.Invoke(this); + + public WeightedAverageValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private double? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// The field from which to extract the values or weights. + /// + public WeightedAverageValueDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to extract the values or weights. + /// + public WeightedAverageValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to extract the values or weights. + /// + public WeightedAverageValueDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// A value or weight to use if the field is missing. + /// + public WeightedAverageValueDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + public WeightedAverageValueDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs new file mode 100644 index 00000000000..79663582dae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public partial class Analyzers : IsADictionary +{ + public Analyzers() + { + } + + public Analyzers(IDictionary container) : base(container) + { + } + + public void Add(string name, IAnalyzer analyzer) => BackingDictionary.Add(Sanitize(name), analyzer); + public bool TryGetAnalyzer(string name, [NotNullWhen(returnValue: true)] out IAnalyzer analyzer) => BackingDictionary.TryGetValue(Sanitize(name), out analyzer); + + public bool TryGetAnalyzer(string name, [NotNullWhen(returnValue: true)] out T? analyzer) where T : class, IAnalyzer + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + analyzer = finalValue; + return true; + } + + analyzer = null; + return false; + } +} + +public sealed partial class AnalyzersDescriptor : IsADictionaryDescriptor +{ + public AnalyzersDescriptor() : base(new Analyzers()) + { + } + + public AnalyzersDescriptor(Analyzers analyzers) : base(analyzers ?? new Analyzers()) + { + } + + public AnalyzersDescriptor Custom(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Custom(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Custom(string analyzerName, CustomAnalyzer customAnalyzer) => AssignVariant(analyzerName, customAnalyzer); + public AnalyzersDescriptor Dutch(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Dutch(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Dutch(string analyzerName, DutchAnalyzer dutchAnalyzer) => AssignVariant(analyzerName, dutchAnalyzer); + public AnalyzersDescriptor Fingerprint(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Fingerprint(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Fingerprint(string analyzerName, FingerprintAnalyzer fingerprintAnalyzer) => AssignVariant(analyzerName, fingerprintAnalyzer); + public AnalyzersDescriptor Icu(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Icu(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Icu(string analyzerName, IcuAnalyzer icuAnalyzer) => AssignVariant(analyzerName, icuAnalyzer); + public AnalyzersDescriptor Keyword(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Keyword(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Keyword(string analyzerName, KeywordAnalyzer keywordAnalyzer) => AssignVariant(analyzerName, keywordAnalyzer); + public AnalyzersDescriptor Kuromoji(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Kuromoji(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Kuromoji(string analyzerName, KuromojiAnalyzer kuromojiAnalyzer) => AssignVariant(analyzerName, kuromojiAnalyzer); + public AnalyzersDescriptor Language(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Language(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Language(string analyzerName, LanguageAnalyzer languageAnalyzer) => AssignVariant(analyzerName, languageAnalyzer); + public AnalyzersDescriptor Nori(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Nori(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Nori(string analyzerName, NoriAnalyzer noriAnalyzer) => AssignVariant(analyzerName, noriAnalyzer); + public AnalyzersDescriptor Pattern(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Pattern(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Pattern(string analyzerName, PatternAnalyzer patternAnalyzer) => AssignVariant(analyzerName, patternAnalyzer); + public AnalyzersDescriptor Simple(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Simple(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Simple(string analyzerName, SimpleAnalyzer simpleAnalyzer) => AssignVariant(analyzerName, simpleAnalyzer); + public AnalyzersDescriptor Snowball(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Snowball(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Snowball(string analyzerName, SnowballAnalyzer snowballAnalyzer) => AssignVariant(analyzerName, snowballAnalyzer); + public AnalyzersDescriptor Standard(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Standard(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Standard(string analyzerName, StandardAnalyzer standardAnalyzer) => AssignVariant(analyzerName, standardAnalyzer); + public AnalyzersDescriptor Stop(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Stop(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Stop(string analyzerName, StopAnalyzer stopAnalyzer) => AssignVariant(analyzerName, stopAnalyzer); + public AnalyzersDescriptor Whitespace(string analyzerName) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Whitespace(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); + public AnalyzersDescriptor Whitespace(string analyzerName, WhitespaceAnalyzer whitespaceAnalyzer) => AssignVariant(analyzerName, whitespaceAnalyzer); +} + +internal sealed partial class AnalyzerInterfaceConverter : JsonConverter +{ + public override IAnalyzer Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "dutch": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_analyzer": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "simple": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "nori": + return JsonSerializer.Deserialize(ref reader, options); + case "language": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + return JsonSerializer.Deserialize(ref reader, options); + case "custom": + return JsonSerializer.Deserialize(ref reader, options); + case null: + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IAnalyzer)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, IAnalyzer value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "dutch": + JsonSerializer.Serialize(writer, value, typeof(DutchAnalyzer), options); + return; + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(SnowballAnalyzer), options); + return; + case "kuromoji": + JsonSerializer.Serialize(writer, value, typeof(KuromojiAnalyzer), options); + return; + case "icu_analyzer": + JsonSerializer.Serialize(writer, value, typeof(IcuAnalyzer), options); + return; + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(WhitespaceAnalyzer), options); + return; + case "stop": + JsonSerializer.Serialize(writer, value, typeof(StopAnalyzer), options); + return; + case "standard": + JsonSerializer.Serialize(writer, value, typeof(StandardAnalyzer), options); + return; + case "simple": + JsonSerializer.Serialize(writer, value, typeof(SimpleAnalyzer), options); + return; + case "pattern": + JsonSerializer.Serialize(writer, value, typeof(PatternAnalyzer), options); + return; + case "nori": + JsonSerializer.Serialize(writer, value, typeof(NoriAnalyzer), options); + return; + case "language": + JsonSerializer.Serialize(writer, value, typeof(LanguageAnalyzer), options); + return; + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(KeywordAnalyzer), options); + return; + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(FingerprintAnalyzer), options); + return; + case "custom": + JsonSerializer.Serialize(writer, value, typeof(CustomAnalyzer), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(AnalyzerInterfaceConverter))] +public partial interface IAnalyzer +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs new file mode 100644 index 00000000000..fb8884e529e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class AsciiFoldingTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "asciifolding"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class AsciiFoldingTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal AsciiFoldingTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public AsciiFoldingTokenFilterDescriptor() : base() + { + } + + private bool? PreserveOriginalValue { get; set; } + private string? VersionValue { get; set; } + + public AsciiFoldingTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public AsciiFoldingTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("asciifolding"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + AsciiFoldingTokenFilter IBuildableDescriptor.Build() => new() + { + PreserveOriginal = PreserveOriginalValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs new file mode 100644 index 00000000000..b078b6bf809 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public partial class CharFilters : IsADictionary +{ + public CharFilters() + { + } + + public CharFilters(IDictionary container) : base(container) + { + } + + public void Add(string name, ICharFilter charFilter) => BackingDictionary.Add(Sanitize(name), charFilter); + public bool TryGetCharFilter(string name, [NotNullWhen(returnValue: true)] out ICharFilter charFilter) => BackingDictionary.TryGetValue(Sanitize(name), out charFilter); + + public bool TryGetCharFilter(string name, [NotNullWhen(returnValue: true)] out T? charFilter) where T : class, ICharFilter + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + charFilter = finalValue; + return true; + } + + charFilter = null; + return false; + } +} + +public sealed partial class CharFiltersDescriptor : IsADictionaryDescriptor +{ + public CharFiltersDescriptor() : base(new CharFilters()) + { + } + + public CharFiltersDescriptor(CharFilters charFilters) : base(charFilters ?? new CharFilters()) + { + } + + public CharFiltersDescriptor HtmlStrip(string charFilterName) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor HtmlStrip(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); + public CharFiltersDescriptor HtmlStrip(string charFilterName, HtmlStripCharFilter htmlStripCharFilter) => AssignVariant(charFilterName, htmlStripCharFilter); + public CharFiltersDescriptor IcuNormalization(string charFilterName) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor IcuNormalization(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); + public CharFiltersDescriptor IcuNormalization(string charFilterName, IcuNormalizationCharFilter icuNormalizationCharFilter) => AssignVariant(charFilterName, icuNormalizationCharFilter); + public CharFiltersDescriptor KuromojiIterationMark(string charFilterName) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor KuromojiIterationMark(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); + public CharFiltersDescriptor KuromojiIterationMark(string charFilterName, KuromojiIterationMarkCharFilter kuromojiIterationMarkCharFilter) => AssignVariant(charFilterName, kuromojiIterationMarkCharFilter); + public CharFiltersDescriptor Mapping(string charFilterName) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor Mapping(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); + public CharFiltersDescriptor Mapping(string charFilterName, MappingCharFilter mappingCharFilter) => AssignVariant(charFilterName, mappingCharFilter); + public CharFiltersDescriptor PatternReplace(string charFilterName) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor PatternReplace(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); + public CharFiltersDescriptor PatternReplace(string charFilterName, PatternReplaceCharFilter patternReplaceCharFilter) => AssignVariant(charFilterName, patternReplaceCharFilter); +} + +internal sealed partial class CharFilterInterfaceConverter : JsonConverter +{ + public override ICharFilter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "kuromoji_iteration_mark": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_normalizer": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); + case "mapping": + return JsonSerializer.Deserialize(ref reader, options); + case "html_strip": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ICharFilter)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, ICharFilter value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "kuromoji_iteration_mark": + JsonSerializer.Serialize(writer, value, typeof(KuromojiIterationMarkCharFilter), options); + return; + case "icu_normalizer": + JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationCharFilter), options); + return; + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(PatternReplaceCharFilter), options); + return; + case "mapping": + JsonSerializer.Serialize(writer, value, typeof(MappingCharFilter), options); + return; + case "html_strip": + JsonSerializer.Serialize(writer, value, typeof(HtmlStripCharFilter), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(CharFilterInterfaceConverter))] +public partial interface ICharFilter +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs new file mode 100644 index 00000000000..1dd08a62b78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class CharGroupTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("max_token_length")] + public int? MaxTokenLength { get; set; } + [JsonInclude, JsonPropertyName("tokenize_on_chars")] + public ICollection TokenizeOnChars { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "char_group"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class CharGroupTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal CharGroupTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public CharGroupTokenizerDescriptor() : base() + { + } + + private int? MaxTokenLengthValue { get; set; } + private ICollection TokenizeOnCharsValue { get; set; } + private string? VersionValue { get; set; } + + public CharGroupTokenizerDescriptor MaxTokenLength(int? maxTokenLength) + { + MaxTokenLengthValue = maxTokenLength; + return Self; + } + + public CharGroupTokenizerDescriptor TokenizeOnChars(ICollection tokenizeOnChars) + { + TokenizeOnCharsValue = tokenizeOnChars; + return Self; + } + + public CharGroupTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenLengthValue.HasValue) + { + writer.WritePropertyName("max_token_length"); + writer.WriteNumberValue(MaxTokenLengthValue.Value); + } + + writer.WritePropertyName("tokenize_on_chars"); + JsonSerializer.Serialize(writer, TokenizeOnCharsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("char_group"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + CharGroupTokenizer IBuildableDescriptor.Build() => new() + { + MaxTokenLength = MaxTokenLengthValue, + TokenizeOnChars = TokenizeOnCharsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs new file mode 100644 index 00000000000..6c8cdb87852 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class CommonGramsTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("common_words")] + public ICollection? CommonWords { get; set; } + [JsonInclude, JsonPropertyName("common_words_path")] + public string? CommonWordsPath { get; set; } + [JsonInclude, JsonPropertyName("ignore_case")] + public bool? IgnoreCase { get; set; } + [JsonInclude, JsonPropertyName("query_mode")] + public bool? QueryMode { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "common_grams"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class CommonGramsTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal CommonGramsTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public CommonGramsTokenFilterDescriptor() : base() + { + } + + private ICollection? CommonWordsValue { get; set; } + private string? CommonWordsPathValue { get; set; } + private bool? IgnoreCaseValue { get; set; } + private bool? QueryModeValue { get; set; } + private string? VersionValue { get; set; } + + public CommonGramsTokenFilterDescriptor CommonWords(ICollection? commonWords) + { + CommonWordsValue = commonWords; + return Self; + } + + public CommonGramsTokenFilterDescriptor CommonWordsPath(string? commonWordsPath) + { + CommonWordsPathValue = commonWordsPath; + return Self; + } + + public CommonGramsTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) + { + IgnoreCaseValue = ignoreCase; + return Self; + } + + public CommonGramsTokenFilterDescriptor QueryMode(bool? queryMode = true) + { + QueryModeValue = queryMode; + return Self; + } + + public CommonGramsTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CommonWordsValue is not null) + { + writer.WritePropertyName("common_words"); + JsonSerializer.Serialize(writer, CommonWordsValue, options); + } + + if (!string.IsNullOrEmpty(CommonWordsPathValue)) + { + writer.WritePropertyName("common_words_path"); + writer.WriteStringValue(CommonWordsPathValue); + } + + if (IgnoreCaseValue.HasValue) + { + writer.WritePropertyName("ignore_case"); + writer.WriteBooleanValue(IgnoreCaseValue.Value); + } + + if (QueryModeValue.HasValue) + { + writer.WritePropertyName("query_mode"); + writer.WriteBooleanValue(QueryModeValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("common_grams"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + CommonGramsTokenFilter IBuildableDescriptor.Build() => new() + { + CommonWords = CommonWordsValue, + CommonWordsPath = CommonWordsPathValue, + IgnoreCase = IgnoreCaseValue, + QueryMode = QueryModeValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs new file mode 100644 index 00000000000..808c10a3af1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class ConditionTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("filter")] + public ICollection Filter { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "condition"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class ConditionTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ConditionTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public ConditionTokenFilterDescriptor() : base() + { + } + + private ICollection FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + private string? VersionValue { get; set; } + + public ConditionTokenFilterDescriptor Filter(ICollection filter) + { + FilterValue = filter; + return Self; + } + + public ConditionTokenFilterDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + public ConditionTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("condition"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + ConditionTokenFilter IBuildableDescriptor.Build() => new() + { + Filter = FilterValue, + Script = ScriptValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomAnalyzer.g.cs new file mode 100644 index 00000000000..4fbb16388b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomAnalyzer.g.cs @@ -0,0 +1,133 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class CustomAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + [JsonInclude, JsonPropertyName("position_increment_gap")] + public int? PositionIncrementGap { get; set; } + [JsonInclude, JsonPropertyName("position_offset_gap")] + public int? PositionOffsetGap { get; set; } + [JsonInclude, JsonPropertyName("tokenizer")] + public string Tokenizer { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "custom"; +} + +public sealed partial class CustomAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal CustomAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public CustomAnalyzerDescriptor() : base() + { + } + + private ICollection? CharFilterValue { get; set; } + private ICollection? FilterValue { get; set; } + private int? PositionIncrementGapValue { get; set; } + private int? PositionOffsetGapValue { get; set; } + private string TokenizerValue { get; set; } + + public CustomAnalyzerDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + public CustomAnalyzerDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + public CustomAnalyzerDescriptor PositionIncrementGap(int? positionIncrementGap) + { + PositionIncrementGapValue = positionIncrementGap; + return Self; + } + + public CustomAnalyzerDescriptor PositionOffsetGap(int? positionOffsetGap) + { + PositionOffsetGapValue = positionOffsetGap; + return Self; + } + + public CustomAnalyzerDescriptor Tokenizer(string tokenizer) + { + TokenizerValue = tokenizer; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, options); + } + + if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (PositionIncrementGapValue.HasValue) + { + writer.WritePropertyName("position_increment_gap"); + writer.WriteNumberValue(PositionIncrementGapValue.Value); + } + + if (PositionOffsetGapValue.HasValue) + { + writer.WritePropertyName("position_offset_gap"); + writer.WriteNumberValue(PositionOffsetGapValue.Value); + } + + writer.WritePropertyName("tokenizer"); + writer.WriteStringValue(TokenizerValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("custom"); + writer.WriteEndObject(); + } + + CustomAnalyzer IBuildableDescriptor.Build() => new() + { + CharFilter = CharFilterValue, + Filter = FilterValue, + PositionIncrementGap = PositionIncrementGapValue, + PositionOffsetGap = PositionOffsetGapValue, + Tokenizer = TokenizerValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomNormalizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomNormalizer.g.cs new file mode 100644 index 00000000000..d860de1f8b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CustomNormalizer.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class CustomNormalizer : INormalizer +{ + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "custom"; +} + +public sealed partial class CustomNormalizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal CustomNormalizerDescriptor(Action configure) => configure.Invoke(this); + + public CustomNormalizerDescriptor() : base() + { + } + + private ICollection? CharFilterValue { get; set; } + private ICollection? FilterValue { get; set; } + + public CustomNormalizerDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + public CustomNormalizerDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, options); + } + + if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("custom"); + writer.WriteEndObject(); + } + + CustomNormalizer IBuildableDescriptor.Build() => new() + { + CharFilter = CharFilterValue, + Filter = FilterValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs new file mode 100644 index 00000000000..044bebe82a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class DelimitedPayloadTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("delimiter")] + public string? Delimiter { get; set; } + [JsonInclude, JsonPropertyName("encoding")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.DelimitedPayloadEncoding? Encoding { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "delimited_payload"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class DelimitedPayloadTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DelimitedPayloadTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public DelimitedPayloadTokenFilterDescriptor() : base() + { + } + + private string? DelimiterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.DelimitedPayloadEncoding? EncodingValue { get; set; } + private string? VersionValue { get; set; } + + public DelimitedPayloadTokenFilterDescriptor Delimiter(string? delimiter) + { + DelimiterValue = delimiter; + return Self; + } + + public DelimitedPayloadTokenFilterDescriptor Encoding(Elastic.Clients.Elasticsearch.Serverless.Analysis.DelimitedPayloadEncoding? encoding) + { + EncodingValue = encoding; + return Self; + } + + public DelimitedPayloadTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DelimiterValue)) + { + writer.WritePropertyName("delimiter"); + writer.WriteStringValue(DelimiterValue); + } + + if (EncodingValue is not null) + { + writer.WritePropertyName("encoding"); + JsonSerializer.Serialize(writer, EncodingValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("delimited_payload"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + DelimitedPayloadTokenFilter IBuildableDescriptor.Build() => new() + { + Delimiter = DelimiterValue, + Encoding = EncodingValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs new file mode 100644 index 00000000000..8e45fe49cdb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class DictionaryDecompounderTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("hyphenation_patterns_path")] + public string? HyphenationPatternsPath { get; set; } + [JsonInclude, JsonPropertyName("max_subword_size")] + public int? MaxSubwordSize { get; set; } + [JsonInclude, JsonPropertyName("min_subword_size")] + public int? MinSubwordSize { get; set; } + [JsonInclude, JsonPropertyName("min_word_size")] + public int? MinWordSize { get; set; } + [JsonInclude, JsonPropertyName("only_longest_match")] + public bool? OnlyLongestMatch { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "dictionary_decompounder"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } + [JsonInclude, JsonPropertyName("word_list")] + public ICollection? WordList { get; set; } + [JsonInclude, JsonPropertyName("word_list_path")] + public string? WordListPath { get; set; } +} + +public sealed partial class DictionaryDecompounderTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DictionaryDecompounderTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public DictionaryDecompounderTokenFilterDescriptor() : base() + { + } + + private string? HyphenationPatternsPathValue { get; set; } + private int? MaxSubwordSizeValue { get; set; } + private int? MinSubwordSizeValue { get; set; } + private int? MinWordSizeValue { get; set; } + private bool? OnlyLongestMatchValue { get; set; } + private string? VersionValue { get; set; } + private ICollection? WordListValue { get; set; } + private string? WordListPathValue { get; set; } + + public DictionaryDecompounderTokenFilterDescriptor HyphenationPatternsPath(string? hyphenationPatternsPath) + { + HyphenationPatternsPathValue = hyphenationPatternsPath; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor MaxSubwordSize(int? maxSubwordSize) + { + MaxSubwordSizeValue = maxSubwordSize; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor MinSubwordSize(int? minSubwordSize) + { + MinSubwordSizeValue = minSubwordSize; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor MinWordSize(int? minWordSize) + { + MinWordSizeValue = minWordSize; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor OnlyLongestMatch(bool? onlyLongestMatch = true) + { + OnlyLongestMatchValue = onlyLongestMatch; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor WordList(ICollection? wordList) + { + WordListValue = wordList; + return Self; + } + + public DictionaryDecompounderTokenFilterDescriptor WordListPath(string? wordListPath) + { + WordListPathValue = wordListPath; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(HyphenationPatternsPathValue)) + { + writer.WritePropertyName("hyphenation_patterns_path"); + writer.WriteStringValue(HyphenationPatternsPathValue); + } + + if (MaxSubwordSizeValue.HasValue) + { + writer.WritePropertyName("max_subword_size"); + writer.WriteNumberValue(MaxSubwordSizeValue.Value); + } + + if (MinSubwordSizeValue.HasValue) + { + writer.WritePropertyName("min_subword_size"); + writer.WriteNumberValue(MinSubwordSizeValue.Value); + } + + if (MinWordSizeValue.HasValue) + { + writer.WritePropertyName("min_word_size"); + writer.WriteNumberValue(MinWordSizeValue.Value); + } + + if (OnlyLongestMatchValue.HasValue) + { + writer.WritePropertyName("only_longest_match"); + writer.WriteBooleanValue(OnlyLongestMatchValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("dictionary_decompounder"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (WordListValue is not null) + { + writer.WritePropertyName("word_list"); + JsonSerializer.Serialize(writer, WordListValue, options); + } + + if (!string.IsNullOrEmpty(WordListPathValue)) + { + writer.WritePropertyName("word_list_path"); + writer.WriteStringValue(WordListPathValue); + } + + writer.WriteEndObject(); + } + + DictionaryDecompounderTokenFilter IBuildableDescriptor.Build() => new() + { + HyphenationPatternsPath = HyphenationPatternsPathValue, + MaxSubwordSize = MaxSubwordSizeValue, + MinSubwordSize = MinSubwordSizeValue, + MinWordSize = MinWordSizeValue, + OnlyLongestMatch = OnlyLongestMatchValue, + Version = VersionValue, + WordList = WordListValue, + WordListPath = WordListPathValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs new file mode 100644 index 00000000000..81412696f38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs @@ -0,0 +1,74 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class DutchAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "dutch"; +} + +public sealed partial class DutchAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DutchAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public DutchAnalyzerDescriptor() : base() + { + } + + private ICollection? StopwordsValue { get; set; } + + public DutchAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("dutch"); + writer.WriteEndObject(); + } + + DutchAnalyzer IBuildableDescriptor.Build() => new() + { + Stopwords = StopwordsValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs new file mode 100644 index 00000000000..dc9d46ce503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class EdgeNGramTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("max_gram")] + public int? MaxGram { get; set; } + [JsonInclude, JsonPropertyName("min_gram")] + public int? MinGram { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + [JsonInclude, JsonPropertyName("side")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.EdgeNGramSide? Side { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "edge_ngram"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class EdgeNGramTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal EdgeNGramTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public EdgeNGramTokenFilterDescriptor() : base() + { + } + + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.EdgeNGramSide? SideValue { get; set; } + private string? VersionValue { get; set; } + + public EdgeNGramTokenFilterDescriptor MaxGram(int? maxGram) + { + MaxGramValue = maxGram; + return Self; + } + + public EdgeNGramTokenFilterDescriptor MinGram(int? minGram) + { + MinGramValue = minGram; + return Self; + } + + public EdgeNGramTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public EdgeNGramTokenFilterDescriptor Side(Elastic.Clients.Elasticsearch.Serverless.Analysis.EdgeNGramSide? side) + { + SideValue = side; + return Self; + } + + public EdgeNGramTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + if (SideValue is not null) + { + writer.WritePropertyName("side"); + JsonSerializer.Serialize(writer, SideValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("edge_ngram"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + EdgeNGramTokenFilter IBuildableDescriptor.Build() => new() + { + MaxGram = MaxGramValue, + MinGram = MinGramValue, + PreserveOriginal = PreserveOriginalValue, + Side = SideValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs new file mode 100644 index 00000000000..f3bf6ea156d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class EdgeNGramTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("custom_token_chars")] + public string? CustomTokenChars { get; set; } + [JsonInclude, JsonPropertyName("max_gram")] + public int MaxGram { get; set; } + [JsonInclude, JsonPropertyName("min_gram")] + public int MinGram { get; set; } + [JsonInclude, JsonPropertyName("token_chars")] + public ICollection TokenChars { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "edge_ngram"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class EdgeNGramTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal EdgeNGramTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public EdgeNGramTokenizerDescriptor() : base() + { + } + + private string? CustomTokenCharsValue { get; set; } + private int MaxGramValue { get; set; } + private int MinGramValue { get; set; } + private ICollection TokenCharsValue { get; set; } + private string? VersionValue { get; set; } + + public EdgeNGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) + { + CustomTokenCharsValue = customTokenChars; + return Self; + } + + public EdgeNGramTokenizerDescriptor MaxGram(int maxGram) + { + MaxGramValue = maxGram; + return Self; + } + + public EdgeNGramTokenizerDescriptor MinGram(int minGram) + { + MinGramValue = minGram; + return Self; + } + + public EdgeNGramTokenizerDescriptor TokenChars(ICollection tokenChars) + { + TokenCharsValue = tokenChars; + return Self; + } + + public EdgeNGramTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CustomTokenCharsValue)) + { + writer.WritePropertyName("custom_token_chars"); + writer.WriteStringValue(CustomTokenCharsValue); + } + + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue); + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue); + writer.WritePropertyName("token_chars"); + JsonSerializer.Serialize(writer, TokenCharsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("edge_ngram"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + EdgeNGramTokenizer IBuildableDescriptor.Build() => new() + { + CustomTokenChars = CustomTokenCharsValue, + MaxGram = MaxGramValue, + MinGram = MinGramValue, + TokenChars = TokenCharsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs new file mode 100644 index 00000000000..c878534044a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class ElisionTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("articles")] + public ICollection? Articles { get; set; } + [JsonInclude, JsonPropertyName("articles_case")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? ArticlesCase { get; set; } + [JsonInclude, JsonPropertyName("articles_path")] + public string? ArticlesPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "elision"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class ElisionTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ElisionTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public ElisionTokenFilterDescriptor() : base() + { + } + + private ICollection? ArticlesValue { get; set; } + private bool? ArticlesCaseValue { get; set; } + private string? ArticlesPathValue { get; set; } + private string? VersionValue { get; set; } + + public ElisionTokenFilterDescriptor Articles(ICollection? articles) + { + ArticlesValue = articles; + return Self; + } + + public ElisionTokenFilterDescriptor ArticlesCase(bool? articlesCase = true) + { + ArticlesCaseValue = articlesCase; + return Self; + } + + public ElisionTokenFilterDescriptor ArticlesPath(string? articlesPath) + { + ArticlesPathValue = articlesPath; + return Self; + } + + public ElisionTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ArticlesValue is not null) + { + writer.WritePropertyName("articles"); + JsonSerializer.Serialize(writer, ArticlesValue, options); + } + + if (ArticlesCaseValue is not null) + { + writer.WritePropertyName("articles_case"); + JsonSerializer.Serialize(writer, ArticlesCaseValue, options); + } + + if (!string.IsNullOrEmpty(ArticlesPathValue)) + { + writer.WritePropertyName("articles_path"); + writer.WriteStringValue(ArticlesPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("elision"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + ElisionTokenFilter IBuildableDescriptor.Build() => new() + { + Articles = ArticlesValue, + ArticlesCase = ArticlesCaseValue, + ArticlesPath = ArticlesPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs new file mode 100644 index 00000000000..a9ca8571029 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class FingerprintAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("max_output_size")] + public int MaxOutputSize { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + public bool PreserveOriginal { get; set; } + [JsonInclude, JsonPropertyName("separator")] + public string Separator { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + [JsonInclude, JsonPropertyName("stopwords_path")] + public string? StopwordsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "fingerprint"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class FingerprintAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FingerprintAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public FingerprintAnalyzerDescriptor() : base() + { + } + + private int MaxOutputSizeValue { get; set; } + private bool PreserveOriginalValue { get; set; } + private string SeparatorValue { get; set; } + private ICollection? StopwordsValue { get; set; } + private string? StopwordsPathValue { get; set; } + private string? VersionValue { get; set; } + + public FingerprintAnalyzerDescriptor MaxOutputSize(int maxOutputSize) + { + MaxOutputSizeValue = maxOutputSize; + return Self; + } + + public FingerprintAnalyzerDescriptor PreserveOriginal(bool preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public FingerprintAnalyzerDescriptor Separator(string separator) + { + SeparatorValue = separator; + return Self; + } + + public FingerprintAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public FingerprintAnalyzerDescriptor StopwordsPath(string? stopwordsPath) + { + StopwordsPathValue = stopwordsPath; + return Self; + } + + public FingerprintAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max_output_size"); + writer.WriteNumberValue(MaxOutputSizeValue); + writer.WritePropertyName("preserve_original"); + writer.WriteBooleanValue(PreserveOriginalValue); + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + if (!string.IsNullOrEmpty(StopwordsPathValue)) + { + writer.WritePropertyName("stopwords_path"); + writer.WriteStringValue(StopwordsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("fingerprint"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + FingerprintAnalyzer IBuildableDescriptor.Build() => new() + { + MaxOutputSize = MaxOutputSizeValue, + PreserveOriginal = PreserveOriginalValue, + Separator = SeparatorValue, + Stopwords = StopwordsValue, + StopwordsPath = StopwordsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs new file mode 100644 index 00000000000..427d920c90c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class FingerprintTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("max_output_size")] + public int? MaxOutputSize { get; set; } + [JsonInclude, JsonPropertyName("separator")] + public string? Separator { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "fingerprint"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class FingerprintTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FingerprintTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public FingerprintTokenFilterDescriptor() : base() + { + } + + private int? MaxOutputSizeValue { get; set; } + private string? SeparatorValue { get; set; } + private string? VersionValue { get; set; } + + public FingerprintTokenFilterDescriptor MaxOutputSize(int? maxOutputSize) + { + MaxOutputSizeValue = maxOutputSize; + return Self; + } + + public FingerprintTokenFilterDescriptor Separator(string? separator) + { + SeparatorValue = separator; + return Self; + } + + public FingerprintTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxOutputSizeValue.HasValue) + { + writer.WritePropertyName("max_output_size"); + writer.WriteNumberValue(MaxOutputSizeValue.Value); + } + + if (!string.IsNullOrEmpty(SeparatorValue)) + { + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("fingerprint"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + FingerprintTokenFilter IBuildableDescriptor.Build() => new() + { + MaxOutputSize = MaxOutputSizeValue, + Separator = SeparatorValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs new file mode 100644 index 00000000000..b037b4255a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class HtmlStripCharFilter : ICharFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "html_strip"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class HtmlStripCharFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal HtmlStripCharFilterDescriptor(Action configure) => configure.Invoke(this); + + public HtmlStripCharFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public HtmlStripCharFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("html_strip"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + HtmlStripCharFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs new file mode 100644 index 00000000000..43c74160147 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class HunspellTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("dedup")] + public bool? Dedup { get; set; } + [JsonInclude, JsonPropertyName("dictionary")] + public string? Dictionary { get; set; } + [JsonInclude, JsonPropertyName("locale")] + public string Locale { get; set; } + [JsonInclude, JsonPropertyName("longest_only")] + public bool? LongestOnly { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "hunspell"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class HunspellTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal HunspellTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public HunspellTokenFilterDescriptor() : base() + { + } + + private bool? DedupValue { get; set; } + private string? DictionaryValue { get; set; } + private string LocaleValue { get; set; } + private bool? LongestOnlyValue { get; set; } + private string? VersionValue { get; set; } + + public HunspellTokenFilterDescriptor Dedup(bool? dedup = true) + { + DedupValue = dedup; + return Self; + } + + public HunspellTokenFilterDescriptor Dictionary(string? dictionary) + { + DictionaryValue = dictionary; + return Self; + } + + public HunspellTokenFilterDescriptor Locale(string locale) + { + LocaleValue = locale; + return Self; + } + + public HunspellTokenFilterDescriptor LongestOnly(bool? longestOnly = true) + { + LongestOnlyValue = longestOnly; + return Self; + } + + public HunspellTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DedupValue.HasValue) + { + writer.WritePropertyName("dedup"); + writer.WriteBooleanValue(DedupValue.Value); + } + + if (!string.IsNullOrEmpty(DictionaryValue)) + { + writer.WritePropertyName("dictionary"); + writer.WriteStringValue(DictionaryValue); + } + + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + if (LongestOnlyValue.HasValue) + { + writer.WritePropertyName("longest_only"); + writer.WriteBooleanValue(LongestOnlyValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("hunspell"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + HunspellTokenFilter IBuildableDescriptor.Build() => new() + { + Dedup = DedupValue, + Dictionary = DictionaryValue, + Locale = LocaleValue, + LongestOnly = LongestOnlyValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs new file mode 100644 index 00000000000..ed593ba8f3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class HyphenationDecompounderTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("hyphenation_patterns_path")] + public string? HyphenationPatternsPath { get; set; } + [JsonInclude, JsonPropertyName("max_subword_size")] + public int? MaxSubwordSize { get; set; } + [JsonInclude, JsonPropertyName("min_subword_size")] + public int? MinSubwordSize { get; set; } + [JsonInclude, JsonPropertyName("min_word_size")] + public int? MinWordSize { get; set; } + [JsonInclude, JsonPropertyName("only_longest_match")] + public bool? OnlyLongestMatch { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "hyphenation_decompounder"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } + [JsonInclude, JsonPropertyName("word_list")] + public ICollection? WordList { get; set; } + [JsonInclude, JsonPropertyName("word_list_path")] + public string? WordListPath { get; set; } +} + +public sealed partial class HyphenationDecompounderTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal HyphenationDecompounderTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public HyphenationDecompounderTokenFilterDescriptor() : base() + { + } + + private string? HyphenationPatternsPathValue { get; set; } + private int? MaxSubwordSizeValue { get; set; } + private int? MinSubwordSizeValue { get; set; } + private int? MinWordSizeValue { get; set; } + private bool? OnlyLongestMatchValue { get; set; } + private string? VersionValue { get; set; } + private ICollection? WordListValue { get; set; } + private string? WordListPathValue { get; set; } + + public HyphenationDecompounderTokenFilterDescriptor HyphenationPatternsPath(string? hyphenationPatternsPath) + { + HyphenationPatternsPathValue = hyphenationPatternsPath; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor MaxSubwordSize(int? maxSubwordSize) + { + MaxSubwordSizeValue = maxSubwordSize; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor MinSubwordSize(int? minSubwordSize) + { + MinSubwordSizeValue = minSubwordSize; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor MinWordSize(int? minWordSize) + { + MinWordSizeValue = minWordSize; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor OnlyLongestMatch(bool? onlyLongestMatch = true) + { + OnlyLongestMatchValue = onlyLongestMatch; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor WordList(ICollection? wordList) + { + WordListValue = wordList; + return Self; + } + + public HyphenationDecompounderTokenFilterDescriptor WordListPath(string? wordListPath) + { + WordListPathValue = wordListPath; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(HyphenationPatternsPathValue)) + { + writer.WritePropertyName("hyphenation_patterns_path"); + writer.WriteStringValue(HyphenationPatternsPathValue); + } + + if (MaxSubwordSizeValue.HasValue) + { + writer.WritePropertyName("max_subword_size"); + writer.WriteNumberValue(MaxSubwordSizeValue.Value); + } + + if (MinSubwordSizeValue.HasValue) + { + writer.WritePropertyName("min_subword_size"); + writer.WriteNumberValue(MinSubwordSizeValue.Value); + } + + if (MinWordSizeValue.HasValue) + { + writer.WritePropertyName("min_word_size"); + writer.WriteNumberValue(MinWordSizeValue.Value); + } + + if (OnlyLongestMatchValue.HasValue) + { + writer.WritePropertyName("only_longest_match"); + writer.WriteBooleanValue(OnlyLongestMatchValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("hyphenation_decompounder"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (WordListValue is not null) + { + writer.WritePropertyName("word_list"); + JsonSerializer.Serialize(writer, WordListValue, options); + } + + if (!string.IsNullOrEmpty(WordListPathValue)) + { + writer.WritePropertyName("word_list_path"); + writer.WriteStringValue(WordListPathValue); + } + + writer.WriteEndObject(); + } + + HyphenationDecompounderTokenFilter IBuildableDescriptor.Build() => new() + { + HyphenationPatternsPath = HyphenationPatternsPathValue, + MaxSubwordSize = MaxSubwordSizeValue, + MinSubwordSize = MinSubwordSizeValue, + MinWordSize = MinWordSizeValue, + OnlyLongestMatch = OnlyLongestMatchValue, + Version = VersionValue, + WordList = WordListValue, + WordListPath = WordListPathValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuAnalyzer.g.cs new file mode 100644 index 00000000000..6742ebcd511 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuAnalyzer.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("method")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType Method { get; set; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode Mode { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_analyzer"; +} + +public sealed partial class IcuAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public IcuAnalyzerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType MethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode ModeValue { get; set; } + + public IcuAnalyzerDescriptor Method(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType method) + { + MethodValue = method; + return Self; + } + + public IcuAnalyzerDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode mode) + { + ModeValue = mode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_analyzer"); + writer.WriteEndObject(); + } + + IcuAnalyzer IBuildableDescriptor.Build() => new() + { + Method = MethodValue, + Mode = ModeValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs new file mode 100644 index 00000000000..a8a54562a6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs @@ -0,0 +1,266 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuCollationTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("alternate")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationAlternate? Alternate { get; set; } + [JsonInclude, JsonPropertyName("caseFirst")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationCaseFirst? Casefirst { get; set; } + [JsonInclude, JsonPropertyName("caseLevel")] + public bool? Caselevel { get; set; } + [JsonInclude, JsonPropertyName("country")] + public string? Country { get; set; } + [JsonInclude, JsonPropertyName("decomposition")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationDecomposition? Decomposition { get; set; } + [JsonInclude, JsonPropertyName("hiraganaQuaternaryMode")] + public bool? Hiraganaquaternarymode { get; set; } + [JsonInclude, JsonPropertyName("language")] + public string? Language { get; set; } + [JsonInclude, JsonPropertyName("numeric")] + public bool? Numeric { get; set; } + [JsonInclude, JsonPropertyName("rules")] + public string? Rules { get; set; } + [JsonInclude, JsonPropertyName("strength")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationStrength? Strength { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_collation"; + + [JsonInclude, JsonPropertyName("variableTop")] + public string? Variabletop { get; set; } + [JsonInclude, JsonPropertyName("variant")] + public string? Variant { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuCollationTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuCollationTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public IcuCollationTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationAlternate? AlternateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationCaseFirst? CasefirstValue { get; set; } + private bool? CaselevelValue { get; set; } + private string? CountryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationDecomposition? DecompositionValue { get; set; } + private bool? HiraganaquaternarymodeValue { get; set; } + private string? LanguageValue { get; set; } + private bool? NumericValue { get; set; } + private string? RulesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationStrength? StrengthValue { get; set; } + private string? VariabletopValue { get; set; } + private string? VariantValue { get; set; } + private string? VersionValue { get; set; } + + public IcuCollationTokenFilterDescriptor Alternate(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationAlternate? alternate) + { + AlternateValue = alternate; + return Self; + } + + public IcuCollationTokenFilterDescriptor Casefirst(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationCaseFirst? casefirst) + { + CasefirstValue = casefirst; + return Self; + } + + public IcuCollationTokenFilterDescriptor Caselevel(bool? caselevel = true) + { + CaselevelValue = caselevel; + return Self; + } + + public IcuCollationTokenFilterDescriptor Country(string? country) + { + CountryValue = country; + return Self; + } + + public IcuCollationTokenFilterDescriptor Decomposition(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationDecomposition? decomposition) + { + DecompositionValue = decomposition; + return Self; + } + + public IcuCollationTokenFilterDescriptor Hiraganaquaternarymode(bool? hiraganaquaternarymode = true) + { + HiraganaquaternarymodeValue = hiraganaquaternarymode; + return Self; + } + + public IcuCollationTokenFilterDescriptor Language(string? language) + { + LanguageValue = language; + return Self; + } + + public IcuCollationTokenFilterDescriptor Numeric(bool? numeric = true) + { + NumericValue = numeric; + return Self; + } + + public IcuCollationTokenFilterDescriptor Rules(string? rules) + { + RulesValue = rules; + return Self; + } + + public IcuCollationTokenFilterDescriptor Strength(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationStrength? strength) + { + StrengthValue = strength; + return Self; + } + + public IcuCollationTokenFilterDescriptor Variabletop(string? variabletop) + { + VariabletopValue = variabletop; + return Self; + } + + public IcuCollationTokenFilterDescriptor Variant(string? variant) + { + VariantValue = variant; + return Self; + } + + public IcuCollationTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlternateValue is not null) + { + writer.WritePropertyName("alternate"); + JsonSerializer.Serialize(writer, AlternateValue, options); + } + + if (CasefirstValue is not null) + { + writer.WritePropertyName("caseFirst"); + JsonSerializer.Serialize(writer, CasefirstValue, options); + } + + if (CaselevelValue.HasValue) + { + writer.WritePropertyName("caseLevel"); + writer.WriteBooleanValue(CaselevelValue.Value); + } + + if (!string.IsNullOrEmpty(CountryValue)) + { + writer.WritePropertyName("country"); + writer.WriteStringValue(CountryValue); + } + + if (DecompositionValue is not null) + { + writer.WritePropertyName("decomposition"); + JsonSerializer.Serialize(writer, DecompositionValue, options); + } + + if (HiraganaquaternarymodeValue.HasValue) + { + writer.WritePropertyName("hiraganaQuaternaryMode"); + writer.WriteBooleanValue(HiraganaquaternarymodeValue.Value); + } + + if (!string.IsNullOrEmpty(LanguageValue)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(LanguageValue); + } + + if (NumericValue.HasValue) + { + writer.WritePropertyName("numeric"); + writer.WriteBooleanValue(NumericValue.Value); + } + + if (!string.IsNullOrEmpty(RulesValue)) + { + writer.WritePropertyName("rules"); + writer.WriteStringValue(RulesValue); + } + + if (StrengthValue is not null) + { + writer.WritePropertyName("strength"); + JsonSerializer.Serialize(writer, StrengthValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_collation"); + if (!string.IsNullOrEmpty(VariabletopValue)) + { + writer.WritePropertyName("variableTop"); + writer.WriteStringValue(VariabletopValue); + } + + if (!string.IsNullOrEmpty(VariantValue)) + { + writer.WritePropertyName("variant"); + writer.WriteStringValue(VariantValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuCollationTokenFilter IBuildableDescriptor.Build() => new() + { + Alternate = AlternateValue, + Casefirst = CasefirstValue, + Caselevel = CaselevelValue, + Country = CountryValue, + Decomposition = DecompositionValue, + Hiraganaquaternarymode = HiraganaquaternarymodeValue, + Language = LanguageValue, + Numeric = NumericValue, + Rules = RulesValue, + Strength = StrengthValue, + Variabletop = VariabletopValue, + Variant = VariantValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs new file mode 100644 index 00000000000..3be32f6fe7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuFoldingTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_folding"; + + [JsonInclude, JsonPropertyName("unicode_set_filter")] + public string UnicodeSetFilter { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuFoldingTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuFoldingTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public IcuFoldingTokenFilterDescriptor() : base() + { + } + + private string UnicodeSetFilterValue { get; set; } + private string? VersionValue { get; set; } + + public IcuFoldingTokenFilterDescriptor UnicodeSetFilter(string unicodeSetFilter) + { + UnicodeSetFilterValue = unicodeSetFilter; + return Self; + } + + public IcuFoldingTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_folding"); + writer.WritePropertyName("unicode_set_filter"); + writer.WriteStringValue(UnicodeSetFilterValue); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuFoldingTokenFilter IBuildableDescriptor.Build() => new() + { + UnicodeSetFilter = UnicodeSetFilterValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs new file mode 100644 index 00000000000..dcdeaf36636 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuNormalizationCharFilter : ICharFilter +{ + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode? Mode { get; set; } + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType? Name { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_normalizer"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuNormalizationCharFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuNormalizationCharFilterDescriptor(Action configure) => configure.Invoke(this); + + public IcuNormalizationCharFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType? NameValue { get; set; } + private string? VersionValue { get; set; } + + public IcuNormalizationCharFilterDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationMode? mode) + { + ModeValue = mode; + return Self; + } + + public IcuNormalizationCharFilterDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType? name) + { + NameValue = name; + return Self; + } + + public IcuNormalizationCharFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_normalizer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuNormalizationCharFilter IBuildableDescriptor.Build() => new() + { + Mode = ModeValue, + Name = NameValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs new file mode 100644 index 00000000000..c6fd50f6827 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuNormalizationTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType Name { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_normalizer"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuNormalizationTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuNormalizationTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public IcuNormalizationTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType NameValue { get; set; } + private string? VersionValue { get; set; } + + public IcuNormalizationTokenFilterDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationType name) + { + NameValue = name; + return Self; + } + + public IcuNormalizationTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_normalizer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuNormalizationTokenFilter IBuildableDescriptor.Build() => new() + { + Name = NameValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs new file mode 100644 index 00000000000..aa8b0a81b65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuTokenizer : ITokenFilter, ITokenizer +{ + [JsonInclude, JsonPropertyName("rule_files")] + public string RuleFiles { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_tokenizer"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public IcuTokenizerDescriptor() : base() + { + } + + private string RuleFilesValue { get; set; } + private string? VersionValue { get; set; } + + public IcuTokenizerDescriptor RuleFiles(string ruleFiles) + { + RuleFilesValue = ruleFiles; + return Self; + } + + public IcuTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("rule_files"); + writer.WriteStringValue(RuleFilesValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_tokenizer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuTokenizer IBuildableDescriptor.Build() => new() + { + RuleFiles = RuleFilesValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs new file mode 100644 index 00000000000..bdc56a68927 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class IcuTransformTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("dir")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuTransformDirection? Dir { get; set; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "icu_transform"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class IcuTransformTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IcuTransformTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public IcuTransformTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuTransformDirection? DirValue { get; set; } + private string IdValue { get; set; } + private string? VersionValue { get; set; } + + public IcuTransformTokenFilterDescriptor Dir(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuTransformDirection? dir) + { + DirValue = dir; + return Self; + } + + public IcuTransformTokenFilterDescriptor Id(string id) + { + IdValue = id; + return Self; + } + + public IcuTransformTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DirValue is not null) + { + writer.WritePropertyName("dir"); + JsonSerializer.Serialize(writer, DirValue, options); + } + + writer.WritePropertyName("id"); + writer.WriteStringValue(IdValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("icu_transform"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + IcuTransformTokenFilter IBuildableDescriptor.Build() => new() + { + Dir = DirValue, + Id = IdValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs new file mode 100644 index 00000000000..ae463d7b395 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KStemTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "kstem"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KStemTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KStemTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KStemTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public KStemTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("kstem"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KStemTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs new file mode 100644 index 00000000000..61099cbe749 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KeepTypesTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.KeepTypesMode? Mode { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "keep_types"; + + [JsonInclude, JsonPropertyName("types")] + public ICollection? Types { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KeepTypesTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeepTypesTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KeepTypesTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.KeepTypesMode? ModeValue { get; set; } + private ICollection? TypesValue { get; set; } + private string? VersionValue { get; set; } + + public KeepTypesTokenFilterDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeepTypesMode? mode) + { + ModeValue = mode; + return Self; + } + + public KeepTypesTokenFilterDescriptor Types(ICollection? types) + { + TypesValue = types; + return Self; + } + + public KeepTypesTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("keep_types"); + if (TypesValue is not null) + { + writer.WritePropertyName("types"); + JsonSerializer.Serialize(writer, TypesValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KeepTypesTokenFilter IBuildableDescriptor.Build() => new() + { + Mode = ModeValue, + Types = TypesValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs new file mode 100644 index 00000000000..6f2dde30cf1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KeepWordsTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("keep_words")] + public ICollection? KeepWords { get; set; } + [JsonInclude, JsonPropertyName("keep_words_case")] + public bool? KeepWordsCase { get; set; } + [JsonInclude, JsonPropertyName("keep_words_path")] + public string? KeepWordsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "keep"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KeepWordsTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeepWordsTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KeepWordsTokenFilterDescriptor() : base() + { + } + + private ICollection? KeepWordsValue { get; set; } + private bool? KeepWordsCaseValue { get; set; } + private string? KeepWordsPathValue { get; set; } + private string? VersionValue { get; set; } + + public KeepWordsTokenFilterDescriptor KeepWords(ICollection? keepWords) + { + KeepWordsValue = keepWords; + return Self; + } + + public KeepWordsTokenFilterDescriptor KeepWordsCase(bool? keepWordsCase = true) + { + KeepWordsCaseValue = keepWordsCase; + return Self; + } + + public KeepWordsTokenFilterDescriptor KeepWordsPath(string? keepWordsPath) + { + KeepWordsPathValue = keepWordsPath; + return Self; + } + + public KeepWordsTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (KeepWordsValue is not null) + { + writer.WritePropertyName("keep_words"); + JsonSerializer.Serialize(writer, KeepWordsValue, options); + } + + if (KeepWordsCaseValue.HasValue) + { + writer.WritePropertyName("keep_words_case"); + writer.WriteBooleanValue(KeepWordsCaseValue.Value); + } + + if (!string.IsNullOrEmpty(KeepWordsPathValue)) + { + writer.WritePropertyName("keep_words_path"); + writer.WriteStringValue(KeepWordsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("keep"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KeepWordsTokenFilter IBuildableDescriptor.Build() => new() + { + KeepWords = KeepWordsValue, + KeepWordsCase = KeepWordsCaseValue, + KeepWordsPath = KeepWordsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs new file mode 100644 index 00000000000..4f619537980 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KeywordAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "keyword"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KeywordAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeywordAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public KeywordAnalyzerDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public KeywordAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("keyword"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KeywordAnalyzer IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs new file mode 100644 index 00000000000..8e355eccab2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KeywordMarkerTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("ignore_case")] + public bool? IgnoreCase { get; set; } + [JsonInclude, JsonPropertyName("keywords")] + public ICollection? Keywords { get; set; } + [JsonInclude, JsonPropertyName("keywords_path")] + public string? KeywordsPath { get; set; } + [JsonInclude, JsonPropertyName("keywords_pattern")] + public string? KeywordsPattern { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "keyword_marker"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KeywordMarkerTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeywordMarkerTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KeywordMarkerTokenFilterDescriptor() : base() + { + } + + private bool? IgnoreCaseValue { get; set; } + private ICollection? KeywordsValue { get; set; } + private string? KeywordsPathValue { get; set; } + private string? KeywordsPatternValue { get; set; } + private string? VersionValue { get; set; } + + public KeywordMarkerTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) + { + IgnoreCaseValue = ignoreCase; + return Self; + } + + public KeywordMarkerTokenFilterDescriptor Keywords(ICollection? keywords) + { + KeywordsValue = keywords; + return Self; + } + + public KeywordMarkerTokenFilterDescriptor KeywordsPath(string? keywordsPath) + { + KeywordsPathValue = keywordsPath; + return Self; + } + + public KeywordMarkerTokenFilterDescriptor KeywordsPattern(string? keywordsPattern) + { + KeywordsPatternValue = keywordsPattern; + return Self; + } + + public KeywordMarkerTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IgnoreCaseValue.HasValue) + { + writer.WritePropertyName("ignore_case"); + writer.WriteBooleanValue(IgnoreCaseValue.Value); + } + + if (KeywordsValue is not null) + { + writer.WritePropertyName("keywords"); + JsonSerializer.Serialize(writer, KeywordsValue, options); + } + + if (!string.IsNullOrEmpty(KeywordsPathValue)) + { + writer.WritePropertyName("keywords_path"); + writer.WriteStringValue(KeywordsPathValue); + } + + if (!string.IsNullOrEmpty(KeywordsPatternValue)) + { + writer.WritePropertyName("keywords_pattern"); + writer.WriteStringValue(KeywordsPatternValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("keyword_marker"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KeywordMarkerTokenFilter IBuildableDescriptor.Build() => new() + { + IgnoreCase = IgnoreCaseValue, + Keywords = KeywordsValue, + KeywordsPath = KeywordsPathValue, + KeywordsPattern = KeywordsPatternValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs new file mode 100644 index 00000000000..5b0837673e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KeywordTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("buffer_size")] + public int BufferSize { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "keyword"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KeywordTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeywordTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public KeywordTokenizerDescriptor() : base() + { + } + + private int BufferSizeValue { get; set; } + private string? VersionValue { get; set; } + + public KeywordTokenizerDescriptor BufferSize(int bufferSize) + { + BufferSizeValue = bufferSize; + return Self; + } + + public KeywordTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("buffer_size"); + writer.WriteNumberValue(BufferSizeValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("keyword"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KeywordTokenizer IBuildableDescriptor.Build() => new() + { + BufferSize = BufferSizeValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs new file mode 100644 index 00000000000..1b2c9c03bc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode Mode { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji"; + + [JsonInclude, JsonPropertyName("user_dictionary")] + public string? UserDictionary { get; set; } +} + +public sealed partial class KuromojiAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiAnalyzerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode ModeValue { get; set; } + private string? UserDictionaryValue { get; set; } + + public KuromojiAnalyzerDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode mode) + { + ModeValue = mode; + return Self; + } + + public KuromojiAnalyzerDescriptor UserDictionary(string? userDictionary) + { + UserDictionaryValue = userDictionary; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji"); + if (!string.IsNullOrEmpty(UserDictionaryValue)) + { + writer.WritePropertyName("user_dictionary"); + writer.WriteStringValue(UserDictionaryValue); + } + + writer.WriteEndObject(); + } + + KuromojiAnalyzer IBuildableDescriptor.Build() => new() + { + Mode = ModeValue, + UserDictionary = UserDictionaryValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs new file mode 100644 index 00000000000..1f912d539bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiIterationMarkCharFilter : ICharFilter +{ + [JsonInclude, JsonPropertyName("normalize_kana")] + public bool NormalizeKana { get; set; } + [JsonInclude, JsonPropertyName("normalize_kanji")] + public bool NormalizeKanji { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji_iteration_mark"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KuromojiIterationMarkCharFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiIterationMarkCharFilterDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiIterationMarkCharFilterDescriptor() : base() + { + } + + private bool NormalizeKanaValue { get; set; } + private bool NormalizeKanjiValue { get; set; } + private string? VersionValue { get; set; } + + public KuromojiIterationMarkCharFilterDescriptor NormalizeKana(bool normalizeKana = true) + { + NormalizeKanaValue = normalizeKana; + return Self; + } + + public KuromojiIterationMarkCharFilterDescriptor NormalizeKanji(bool normalizeKanji = true) + { + NormalizeKanjiValue = normalizeKanji; + return Self; + } + + public KuromojiIterationMarkCharFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("normalize_kana"); + writer.WriteBooleanValue(NormalizeKanaValue); + writer.WritePropertyName("normalize_kanji"); + writer.WriteBooleanValue(NormalizeKanjiValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji_iteration_mark"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KuromojiIterationMarkCharFilter IBuildableDescriptor.Build() => new() + { + NormalizeKana = NormalizeKanaValue, + NormalizeKanji = NormalizeKanjiValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs new file mode 100644 index 00000000000..c3411dd43ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiPartOfSpeechTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("stoptags")] + public ICollection Stoptags { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji_part_of_speech"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KuromojiPartOfSpeechTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiPartOfSpeechTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiPartOfSpeechTokenFilterDescriptor() : base() + { + } + + private ICollection StoptagsValue { get; set; } + private string? VersionValue { get; set; } + + public KuromojiPartOfSpeechTokenFilterDescriptor Stoptags(ICollection stoptags) + { + StoptagsValue = stoptags; + return Self; + } + + public KuromojiPartOfSpeechTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("stoptags"); + JsonSerializer.Serialize(writer, StoptagsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji_part_of_speech"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KuromojiPartOfSpeechTokenFilter IBuildableDescriptor.Build() => new() + { + Stoptags = StoptagsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs new file mode 100644 index 00000000000..f1619a02ed9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiReadingFormTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji_readingform"; + + [JsonInclude, JsonPropertyName("use_romaji")] + public bool UseRomaji { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KuromojiReadingFormTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiReadingFormTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiReadingFormTokenFilterDescriptor() : base() + { + } + + private bool UseRomajiValue { get; set; } + private string? VersionValue { get; set; } + + public KuromojiReadingFormTokenFilterDescriptor UseRomaji(bool useRomaji = true) + { + UseRomajiValue = useRomaji; + return Self; + } + + public KuromojiReadingFormTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji_readingform"); + writer.WritePropertyName("use_romaji"); + writer.WriteBooleanValue(UseRomajiValue); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KuromojiReadingFormTokenFilter IBuildableDescriptor.Build() => new() + { + UseRomaji = UseRomajiValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs new file mode 100644 index 00000000000..bd568ac6e9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiStemmerTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("minimum_length")] + public int MinimumLength { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji_stemmer"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KuromojiStemmerTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiStemmerTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiStemmerTokenFilterDescriptor() : base() + { + } + + private int MinimumLengthValue { get; set; } + private string? VersionValue { get; set; } + + public KuromojiStemmerTokenFilterDescriptor MinimumLength(int minimumLength) + { + MinimumLengthValue = minimumLength; + return Self; + } + + public KuromojiStemmerTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("minimum_length"); + writer.WriteNumberValue(MinimumLengthValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji_stemmer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KuromojiStemmerTokenFilter IBuildableDescriptor.Build() => new() + { + MinimumLength = MinimumLengthValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs new file mode 100644 index 00000000000..1a3afce7c87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs @@ -0,0 +1,182 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class KuromojiTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("discard_compound_token")] + public bool? DiscardCompoundToken { get; set; } + [JsonInclude, JsonPropertyName("discard_punctuation")] + public bool? DiscardPunctuation { get; set; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode Mode { get; set; } + [JsonInclude, JsonPropertyName("nbest_cost")] + public int? NbestCost { get; set; } + [JsonInclude, JsonPropertyName("nbest_examples")] + public string? NbestExamples { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "kuromoji_tokenizer"; + + [JsonInclude, JsonPropertyName("user_dictionary")] + public string? UserDictionary { get; set; } + [JsonInclude, JsonPropertyName("user_dictionary_rules")] + public ICollection? UserDictionaryRules { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class KuromojiTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KuromojiTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public KuromojiTokenizerDescriptor() : base() + { + } + + private bool? DiscardCompoundTokenValue { get; set; } + private bool? DiscardPunctuationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode ModeValue { get; set; } + private int? NbestCostValue { get; set; } + private string? NbestExamplesValue { get; set; } + private string? UserDictionaryValue { get; set; } + private ICollection? UserDictionaryRulesValue { get; set; } + private string? VersionValue { get; set; } + + public KuromojiTokenizerDescriptor DiscardCompoundToken(bool? discardCompoundToken = true) + { + DiscardCompoundTokenValue = discardCompoundToken; + return Self; + } + + public KuromojiTokenizerDescriptor DiscardPunctuation(bool? discardPunctuation = true) + { + DiscardPunctuationValue = discardPunctuation; + return Self; + } + + public KuromojiTokenizerDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizationMode mode) + { + ModeValue = mode; + return Self; + } + + public KuromojiTokenizerDescriptor NbestCost(int? nbestCost) + { + NbestCostValue = nbestCost; + return Self; + } + + public KuromojiTokenizerDescriptor NbestExamples(string? nbestExamples) + { + NbestExamplesValue = nbestExamples; + return Self; + } + + public KuromojiTokenizerDescriptor UserDictionary(string? userDictionary) + { + UserDictionaryValue = userDictionary; + return Self; + } + + public KuromojiTokenizerDescriptor UserDictionaryRules(ICollection? userDictionaryRules) + { + UserDictionaryRulesValue = userDictionaryRules; + return Self; + } + + public KuromojiTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DiscardCompoundTokenValue.HasValue) + { + writer.WritePropertyName("discard_compound_token"); + writer.WriteBooleanValue(DiscardCompoundTokenValue.Value); + } + + if (DiscardPunctuationValue.HasValue) + { + writer.WritePropertyName("discard_punctuation"); + writer.WriteBooleanValue(DiscardPunctuationValue.Value); + } + + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + if (NbestCostValue.HasValue) + { + writer.WritePropertyName("nbest_cost"); + writer.WriteNumberValue(NbestCostValue.Value); + } + + if (!string.IsNullOrEmpty(NbestExamplesValue)) + { + writer.WritePropertyName("nbest_examples"); + writer.WriteStringValue(NbestExamplesValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("kuromoji_tokenizer"); + if (!string.IsNullOrEmpty(UserDictionaryValue)) + { + writer.WritePropertyName("user_dictionary"); + writer.WriteStringValue(UserDictionaryValue); + } + + if (UserDictionaryRulesValue is not null) + { + writer.WritePropertyName("user_dictionary_rules"); + JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + KuromojiTokenizer IBuildableDescriptor.Build() => new() + { + DiscardCompoundToken = DiscardCompoundTokenValue, + DiscardPunctuation = DiscardPunctuationValue, + Mode = ModeValue, + NbestCost = NbestCostValue, + NbestExamples = NbestExamplesValue, + UserDictionary = UserDictionaryValue, + UserDictionaryRules = UserDictionaryRulesValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs new file mode 100644 index 00000000000..6f9013ce1b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs @@ -0,0 +1,131 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LanguageAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("language")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.Language Language { get; set; } + [JsonInclude, JsonPropertyName("stem_exclusion")] + public ICollection StemExclusion { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + [JsonInclude, JsonPropertyName("stopwords_path")] + public string? StopwordsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "language"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LanguageAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LanguageAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public LanguageAnalyzerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Language LanguageValue { get; set; } + private ICollection StemExclusionValue { get; set; } + private ICollection? StopwordsValue { get; set; } + private string? StopwordsPathValue { get; set; } + private string? VersionValue { get; set; } + + public LanguageAnalyzerDescriptor Language(Elastic.Clients.Elasticsearch.Serverless.Analysis.Language language) + { + LanguageValue = language; + return Self; + } + + public LanguageAnalyzerDescriptor StemExclusion(ICollection stemExclusion) + { + StemExclusionValue = stemExclusion; + return Self; + } + + public LanguageAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public LanguageAnalyzerDescriptor StopwordsPath(string? stopwordsPath) + { + StopwordsPathValue = stopwordsPath; + return Self; + } + + public LanguageAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("language"); + JsonSerializer.Serialize(writer, LanguageValue, options); + writer.WritePropertyName("stem_exclusion"); + JsonSerializer.Serialize(writer, StemExclusionValue, options); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + if (!string.IsNullOrEmpty(StopwordsPathValue)) + { + writer.WritePropertyName("stopwords_path"); + writer.WriteStringValue(StopwordsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("language"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LanguageAnalyzer IBuildableDescriptor.Build() => new() + { + Language = LanguageValue, + StemExclusion = StemExclusionValue, + Stopwords = StopwordsValue, + StopwordsPath = StopwordsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs new file mode 100644 index 00000000000..c0d8e50503b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LengthTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("max")] + public int? Max { get; set; } + [JsonInclude, JsonPropertyName("min")] + public int? Min { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "length"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LengthTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LengthTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public LengthTokenFilterDescriptor() : base() + { + } + + private int? MaxValue { get; set; } + private int? MinValue { get; set; } + private string? VersionValue { get; set; } + + public LengthTokenFilterDescriptor Max(int? max) + { + MaxValue = max; + return Self; + } + + public LengthTokenFilterDescriptor Min(int? min) + { + MinValue = min; + return Self; + } + + public LengthTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxValue.HasValue) + { + writer.WritePropertyName("max"); + writer.WriteNumberValue(MaxValue.Value); + } + + if (MinValue.HasValue) + { + writer.WritePropertyName("min"); + writer.WriteNumberValue(MinValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("length"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LengthTokenFilter IBuildableDescriptor.Build() => new() + { + Max = MaxValue, + Min = MinValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs new file mode 100644 index 00000000000..e55ef0131b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LetterTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "letter"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LetterTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LetterTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public LetterTokenizerDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public LetterTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("letter"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LetterTokenizer IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs new file mode 100644 index 00000000000..ed7ad152be1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LimitTokenCountTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("consume_all_tokens")] + public bool? ConsumeAllTokens { get; set; } + [JsonInclude, JsonPropertyName("max_token_count")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int? MaxTokenCount { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "limit"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LimitTokenCountTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LimitTokenCountTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public LimitTokenCountTokenFilterDescriptor() : base() + { + } + + private bool? ConsumeAllTokensValue { get; set; } + private int? MaxTokenCountValue { get; set; } + private string? VersionValue { get; set; } + + public LimitTokenCountTokenFilterDescriptor ConsumeAllTokens(bool? consumeAllTokens = true) + { + ConsumeAllTokensValue = consumeAllTokens; + return Self; + } + + public LimitTokenCountTokenFilterDescriptor MaxTokenCount(int? maxTokenCount) + { + MaxTokenCountValue = maxTokenCount; + return Self; + } + + public LimitTokenCountTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConsumeAllTokensValue.HasValue) + { + writer.WritePropertyName("consume_all_tokens"); + writer.WriteBooleanValue(ConsumeAllTokensValue.Value); + } + + if (MaxTokenCountValue is not null) + { + writer.WritePropertyName("max_token_count"); + JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("limit"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LimitTokenCountTokenFilter IBuildableDescriptor.Build() => new() + { + ConsumeAllTokens = ConsumeAllTokensValue, + MaxTokenCount = MaxTokenCountValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseNormalizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseNormalizer.g.cs new file mode 100644 index 00000000000..91e6d9b7986 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseNormalizer.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LowercaseNormalizer : INormalizer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "lowercase"; +} + +public sealed partial class LowercaseNormalizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LowercaseNormalizerDescriptor(Action configure) => configure.Invoke(this); + + public LowercaseNormalizerDescriptor() : base() + { + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("lowercase"); + writer.WriteEndObject(); + } + + LowercaseNormalizer IBuildableDescriptor.Build() => new() + { + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs new file mode 100644 index 00000000000..656d2ac8147 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LowercaseTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("language")] + public string? Language { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "lowercase"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LowercaseTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LowercaseTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public LowercaseTokenFilterDescriptor() : base() + { + } + + private string? LanguageValue { get; set; } + private string? VersionValue { get; set; } + + public LowercaseTokenFilterDescriptor Language(string? language) + { + LanguageValue = language; + return Self; + } + + public LowercaseTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LanguageValue)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(LanguageValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("lowercase"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LowercaseTokenFilter IBuildableDescriptor.Build() => new() + { + Language = LanguageValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs new file mode 100644 index 00000000000..fa07591c7f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class LowercaseTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "lowercase"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class LowercaseTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LowercaseTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public LowercaseTokenizerDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public LowercaseTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("lowercase"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + LowercaseTokenizer IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs new file mode 100644 index 00000000000..5bee705fc2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class MappingCharFilter : ICharFilter +{ + [JsonInclude, JsonPropertyName("mappings")] + public ICollection? Mappings { get; set; } + [JsonInclude, JsonPropertyName("mappings_path")] + public string? MappingsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "mapping"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class MappingCharFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal MappingCharFilterDescriptor(Action configure) => configure.Invoke(this); + + public MappingCharFilterDescriptor() : base() + { + } + + private ICollection? MappingsValue { get; set; } + private string? MappingsPathValue { get; set; } + private string? VersionValue { get; set; } + + public MappingCharFilterDescriptor Mappings(ICollection? mappings) + { + MappingsValue = mappings; + return Self; + } + + public MappingCharFilterDescriptor MappingsPath(string? mappingsPath) + { + MappingsPathValue = mappingsPath; + return Self; + } + + public MappingCharFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (!string.IsNullOrEmpty(MappingsPathValue)) + { + writer.WritePropertyName("mappings_path"); + writer.WriteStringValue(MappingsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("mapping"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + MappingCharFilter IBuildableDescriptor.Build() => new() + { + Mappings = MappingsValue, + MappingsPath = MappingsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs new file mode 100644 index 00000000000..c1365727e8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class MultiplexerTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("filters")] + public ICollection Filters { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "multiplexer"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class MultiplexerTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal MultiplexerTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public MultiplexerTokenFilterDescriptor() : base() + { + } + + private ICollection FiltersValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private string? VersionValue { get; set; } + + public MultiplexerTokenFilterDescriptor Filters(ICollection filters) + { + FiltersValue = filters; + return Self; + } + + public MultiplexerTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public MultiplexerTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filters"); + JsonSerializer.Serialize(writer, FiltersValue, options); + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("multiplexer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + MultiplexerTokenFilter IBuildableDescriptor.Build() => new() + { + Filters = FiltersValue, + PreserveOriginal = PreserveOriginalValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs new file mode 100644 index 00000000000..1cb779a4c5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class NGramTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("max_gram")] + public int? MaxGram { get; set; } + [JsonInclude, JsonPropertyName("min_gram")] + public int? MinGram { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "ngram"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class NGramTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NGramTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public NGramTokenFilterDescriptor() : base() + { + } + + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private string? VersionValue { get; set; } + + public NGramTokenFilterDescriptor MaxGram(int? maxGram) + { + MaxGramValue = maxGram; + return Self; + } + + public NGramTokenFilterDescriptor MinGram(int? minGram) + { + MinGramValue = minGram; + return Self; + } + + public NGramTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public NGramTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("ngram"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + NGramTokenFilter IBuildableDescriptor.Build() => new() + { + MaxGram = MaxGramValue, + MinGram = MinGramValue, + PreserveOriginal = PreserveOriginalValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs new file mode 100644 index 00000000000..2b6c04e6a37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class NGramTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("custom_token_chars")] + public string? CustomTokenChars { get; set; } + [JsonInclude, JsonPropertyName("max_gram")] + public int MaxGram { get; set; } + [JsonInclude, JsonPropertyName("min_gram")] + public int MinGram { get; set; } + [JsonInclude, JsonPropertyName("token_chars")] + public ICollection TokenChars { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "ngram"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class NGramTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NGramTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public NGramTokenizerDescriptor() : base() + { + } + + private string? CustomTokenCharsValue { get; set; } + private int MaxGramValue { get; set; } + private int MinGramValue { get; set; } + private ICollection TokenCharsValue { get; set; } + private string? VersionValue { get; set; } + + public NGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) + { + CustomTokenCharsValue = customTokenChars; + return Self; + } + + public NGramTokenizerDescriptor MaxGram(int maxGram) + { + MaxGramValue = maxGram; + return Self; + } + + public NGramTokenizerDescriptor MinGram(int minGram) + { + MinGramValue = minGram; + return Self; + } + + public NGramTokenizerDescriptor TokenChars(ICollection tokenChars) + { + TokenCharsValue = tokenChars; + return Self; + } + + public NGramTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CustomTokenCharsValue)) + { + writer.WritePropertyName("custom_token_chars"); + writer.WriteStringValue(CustomTokenCharsValue); + } + + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue); + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue); + writer.WritePropertyName("token_chars"); + JsonSerializer.Serialize(writer, TokenCharsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("ngram"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + NGramTokenizer IBuildableDescriptor.Build() => new() + { + CustomTokenChars = CustomTokenCharsValue, + MaxGram = MaxGramValue, + MinGram = MinGramValue, + TokenChars = TokenCharsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs new file mode 100644 index 00000000000..f10bb061663 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class NoriAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("decompound_mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? DecompoundMode { get; set; } + [JsonInclude, JsonPropertyName("stoptags")] + public ICollection? Stoptags { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "nori"; + + [JsonInclude, JsonPropertyName("user_dictionary")] + public string? UserDictionary { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class NoriAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NoriAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public NoriAnalyzerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? DecompoundModeValue { get; set; } + private ICollection? StoptagsValue { get; set; } + private string? UserDictionaryValue { get; set; } + private string? VersionValue { get; set; } + + public NoriAnalyzerDescriptor DecompoundMode(Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? decompoundMode) + { + DecompoundModeValue = decompoundMode; + return Self; + } + + public NoriAnalyzerDescriptor Stoptags(ICollection? stoptags) + { + StoptagsValue = stoptags; + return Self; + } + + public NoriAnalyzerDescriptor UserDictionary(string? userDictionary) + { + UserDictionaryValue = userDictionary; + return Self; + } + + public NoriAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DecompoundModeValue is not null) + { + writer.WritePropertyName("decompound_mode"); + JsonSerializer.Serialize(writer, DecompoundModeValue, options); + } + + if (StoptagsValue is not null) + { + writer.WritePropertyName("stoptags"); + JsonSerializer.Serialize(writer, StoptagsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("nori"); + if (!string.IsNullOrEmpty(UserDictionaryValue)) + { + writer.WritePropertyName("user_dictionary"); + writer.WriteStringValue(UserDictionaryValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + NoriAnalyzer IBuildableDescriptor.Build() => new() + { + DecompoundMode = DecompoundModeValue, + Stoptags = StoptagsValue, + UserDictionary = UserDictionaryValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs new file mode 100644 index 00000000000..a7cffd76e15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class NoriPartOfSpeechTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("stoptags")] + public ICollection? Stoptags { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "nori_part_of_speech"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class NoriPartOfSpeechTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NoriPartOfSpeechTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public NoriPartOfSpeechTokenFilterDescriptor() : base() + { + } + + private ICollection? StoptagsValue { get; set; } + private string? VersionValue { get; set; } + + public NoriPartOfSpeechTokenFilterDescriptor Stoptags(ICollection? stoptags) + { + StoptagsValue = stoptags; + return Self; + } + + public NoriPartOfSpeechTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (StoptagsValue is not null) + { + writer.WritePropertyName("stoptags"); + JsonSerializer.Serialize(writer, StoptagsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("nori_part_of_speech"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + NoriPartOfSpeechTokenFilter IBuildableDescriptor.Build() => new() + { + Stoptags = StoptagsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs new file mode 100644 index 00000000000..f34a0d7c96f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class NoriTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("decompound_mode")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? DecompoundMode { get; set; } + [JsonInclude, JsonPropertyName("discard_punctuation")] + public bool? DiscardPunctuation { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "nori_tokenizer"; + + [JsonInclude, JsonPropertyName("user_dictionary")] + public string? UserDictionary { get; set; } + [JsonInclude, JsonPropertyName("user_dictionary_rules")] + public ICollection? UserDictionaryRules { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class NoriTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NoriTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public NoriTokenizerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? DecompoundModeValue { get; set; } + private bool? DiscardPunctuationValue { get; set; } + private string? UserDictionaryValue { get; set; } + private ICollection? UserDictionaryRulesValue { get; set; } + private string? VersionValue { get; set; } + + public NoriTokenizerDescriptor DecompoundMode(Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriDecompoundMode? decompoundMode) + { + DecompoundModeValue = decompoundMode; + return Self; + } + + public NoriTokenizerDescriptor DiscardPunctuation(bool? discardPunctuation = true) + { + DiscardPunctuationValue = discardPunctuation; + return Self; + } + + public NoriTokenizerDescriptor UserDictionary(string? userDictionary) + { + UserDictionaryValue = userDictionary; + return Self; + } + + public NoriTokenizerDescriptor UserDictionaryRules(ICollection? userDictionaryRules) + { + UserDictionaryRulesValue = userDictionaryRules; + return Self; + } + + public NoriTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DecompoundModeValue is not null) + { + writer.WritePropertyName("decompound_mode"); + JsonSerializer.Serialize(writer, DecompoundModeValue, options); + } + + if (DiscardPunctuationValue.HasValue) + { + writer.WritePropertyName("discard_punctuation"); + writer.WriteBooleanValue(DiscardPunctuationValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("nori_tokenizer"); + if (!string.IsNullOrEmpty(UserDictionaryValue)) + { + writer.WritePropertyName("user_dictionary"); + writer.WriteStringValue(UserDictionaryValue); + } + + if (UserDictionaryRulesValue is not null) + { + writer.WritePropertyName("user_dictionary_rules"); + JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + NoriTokenizer IBuildableDescriptor.Build() => new() + { + DecompoundMode = DecompoundModeValue, + DiscardPunctuation = DiscardPunctuationValue, + UserDictionary = UserDictionaryValue, + UserDictionaryRules = UserDictionaryRulesValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs new file mode 100644 index 00000000000..a49a0403275 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs @@ -0,0 +1,129 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public partial class Normalizers : IsADictionary +{ + public Normalizers() + { + } + + public Normalizers(IDictionary container) : base(container) + { + } + + public void Add(string name, INormalizer normalizer) => BackingDictionary.Add(Sanitize(name), normalizer); + public bool TryGetNormalizer(string name, [NotNullWhen(returnValue: true)] out INormalizer normalizer) => BackingDictionary.TryGetValue(Sanitize(name), out normalizer); + + public bool TryGetNormalizer(string name, [NotNullWhen(returnValue: true)] out T? normalizer) where T : class, INormalizer + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + normalizer = finalValue; + return true; + } + + normalizer = null; + return false; + } +} + +public sealed partial class NormalizersDescriptor : IsADictionaryDescriptor +{ + public NormalizersDescriptor() : base(new Normalizers()) + { + } + + public NormalizersDescriptor(Normalizers normalizers) : base(normalizers ?? new Normalizers()) + { + } + + public NormalizersDescriptor Custom(string normalizerName) => AssignVariant(normalizerName, null); + public NormalizersDescriptor Custom(string normalizerName, Action configure) => AssignVariant(normalizerName, configure); + public NormalizersDescriptor Custom(string normalizerName, CustomNormalizer customNormalizer) => AssignVariant(normalizerName, customNormalizer); + public NormalizersDescriptor Lowercase(string normalizerName) => AssignVariant(normalizerName, null); + public NormalizersDescriptor Lowercase(string normalizerName, Action configure) => AssignVariant(normalizerName, configure); + public NormalizersDescriptor Lowercase(string normalizerName, LowercaseNormalizer lowercaseNormalizer) => AssignVariant(normalizerName, lowercaseNormalizer); +} + +internal sealed partial class NormalizerInterfaceConverter : JsonConverter +{ + public override INormalizer Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "custom": + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(INormalizer)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, INormalizer value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "custom": + JsonSerializer.Serialize(writer, value, typeof(CustomNormalizer), options); + return; + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(LowercaseNormalizer), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(NormalizerInterfaceConverter))] +public partial interface INormalizer +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs new file mode 100644 index 00000000000..c491c9d6121 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PathHierarchyTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("buffer_size")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int BufferSize { get; set; } + [JsonInclude, JsonPropertyName("delimiter")] + public string Delimiter { get; set; } + [JsonInclude, JsonPropertyName("replacement")] + public string Replacement { get; set; } + [JsonInclude, JsonPropertyName("reverse")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool Reverse { get; set; } + [JsonInclude, JsonPropertyName("skip")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int Skip { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "path_hierarchy"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PathHierarchyTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PathHierarchyTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public PathHierarchyTokenizerDescriptor() : base() + { + } + + private int BufferSizeValue { get; set; } + private string DelimiterValue { get; set; } + private string ReplacementValue { get; set; } + private bool ReverseValue { get; set; } + private int SkipValue { get; set; } + private string? VersionValue { get; set; } + + public PathHierarchyTokenizerDescriptor BufferSize(int bufferSize) + { + BufferSizeValue = bufferSize; + return Self; + } + + public PathHierarchyTokenizerDescriptor Delimiter(string delimiter) + { + DelimiterValue = delimiter; + return Self; + } + + public PathHierarchyTokenizerDescriptor Replacement(string replacement) + { + ReplacementValue = replacement; + return Self; + } + + public PathHierarchyTokenizerDescriptor Reverse(bool reverse = true) + { + ReverseValue = reverse; + return Self; + } + + public PathHierarchyTokenizerDescriptor Skip(int skip) + { + SkipValue = skip; + return Self; + } + + public PathHierarchyTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("buffer_size"); + JsonSerializer.Serialize(writer, BufferSizeValue, options); + writer.WritePropertyName("delimiter"); + writer.WriteStringValue(DelimiterValue); + writer.WritePropertyName("replacement"); + writer.WriteStringValue(ReplacementValue); + writer.WritePropertyName("reverse"); + JsonSerializer.Serialize(writer, ReverseValue, options); + writer.WritePropertyName("skip"); + JsonSerializer.Serialize(writer, SkipValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("path_hierarchy"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PathHierarchyTokenizer IBuildableDescriptor.Build() => new() + { + BufferSize = BufferSizeValue, + Delimiter = DelimiterValue, + Replacement = ReplacementValue, + Reverse = ReverseValue, + Skip = SkipValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs new file mode 100644 index 00000000000..84603a1c4df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PatternAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("flags")] + public string? Flags { get; set; } + [JsonInclude, JsonPropertyName("lowercase")] + public bool? Lowercase { get; set; } + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "pattern"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PatternAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PatternAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public PatternAnalyzerDescriptor() : base() + { + } + + private string? FlagsValue { get; set; } + private bool? LowercaseValue { get; set; } + private string PatternValue { get; set; } + private ICollection? StopwordsValue { get; set; } + private string? VersionValue { get; set; } + + public PatternAnalyzerDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + public PatternAnalyzerDescriptor Lowercase(bool? lowercase = true) + { + LowercaseValue = lowercase; + return Self; + } + + public PatternAnalyzerDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + public PatternAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public PatternAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + if (LowercaseValue.HasValue) + { + writer.WritePropertyName("lowercase"); + writer.WriteBooleanValue(LowercaseValue.Value); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("pattern"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PatternAnalyzer IBuildableDescriptor.Build() => new() + { + Flags = FlagsValue, + Lowercase = LowercaseValue, + Pattern = PatternValue, + Stopwords = StopwordsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs new file mode 100644 index 00000000000..f1a9b65cb21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PatternCaptureTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("patterns")] + public ICollection Patterns { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "pattern_capture"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PatternCaptureTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PatternCaptureTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public PatternCaptureTokenFilterDescriptor() : base() + { + } + + private ICollection PatternsValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private string? VersionValue { get; set; } + + public PatternCaptureTokenFilterDescriptor Patterns(ICollection patterns) + { + PatternsValue = patterns; + return Self; + } + + public PatternCaptureTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public PatternCaptureTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("patterns"); + JsonSerializer.Serialize(writer, PatternsValue, options); + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("pattern_capture"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PatternCaptureTokenFilter IBuildableDescriptor.Build() => new() + { + Patterns = PatternsValue, + PreserveOriginal = PreserveOriginalValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs new file mode 100644 index 00000000000..ae692a66ae6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs @@ -0,0 +1,118 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PatternReplaceCharFilter : ICharFilter +{ + [JsonInclude, JsonPropertyName("flags")] + public string? Flags { get; set; } + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + [JsonInclude, JsonPropertyName("replacement")] + public string? Replacement { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "pattern_replace"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PatternReplaceCharFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PatternReplaceCharFilterDescriptor(Action configure) => configure.Invoke(this); + + public PatternReplaceCharFilterDescriptor() : base() + { + } + + private string? FlagsValue { get; set; } + private string PatternValue { get; set; } + private string? ReplacementValue { get; set; } + private string? VersionValue { get; set; } + + public PatternReplaceCharFilterDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + public PatternReplaceCharFilterDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + public PatternReplaceCharFilterDescriptor Replacement(string? replacement) + { + ReplacementValue = replacement; + return Self; + } + + public PatternReplaceCharFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (!string.IsNullOrEmpty(ReplacementValue)) + { + writer.WritePropertyName("replacement"); + writer.WriteStringValue(ReplacementValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("pattern_replace"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PatternReplaceCharFilter IBuildableDescriptor.Build() => new() + { + Flags = FlagsValue, + Pattern = PatternValue, + Replacement = ReplacementValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs new file mode 100644 index 00000000000..12b89661cce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PatternReplaceTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("all")] + public bool? All { get; set; } + [JsonInclude, JsonPropertyName("flags")] + public string? Flags { get; set; } + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + [JsonInclude, JsonPropertyName("replacement")] + public string? Replacement { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "pattern_replace"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PatternReplaceTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PatternReplaceTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public PatternReplaceTokenFilterDescriptor() : base() + { + } + + private bool? AllValue { get; set; } + private string? FlagsValue { get; set; } + private string PatternValue { get; set; } + private string? ReplacementValue { get; set; } + private string? VersionValue { get; set; } + + public PatternReplaceTokenFilterDescriptor All(bool? all = true) + { + AllValue = all; + return Self; + } + + public PatternReplaceTokenFilterDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + public PatternReplaceTokenFilterDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + public PatternReplaceTokenFilterDescriptor Replacement(string? replacement) + { + ReplacementValue = replacement; + return Self; + } + + public PatternReplaceTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllValue.HasValue) + { + writer.WritePropertyName("all"); + writer.WriteBooleanValue(AllValue.Value); + } + + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (!string.IsNullOrEmpty(ReplacementValue)) + { + writer.WritePropertyName("replacement"); + writer.WriteStringValue(ReplacementValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("pattern_replace"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PatternReplaceTokenFilter IBuildableDescriptor.Build() => new() + { + All = AllValue, + Flags = FlagsValue, + Pattern = PatternValue, + Replacement = ReplacementValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs new file mode 100644 index 00000000000..67da6385f2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PatternTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("flags")] + public string? Flags { get; set; } + [JsonInclude, JsonPropertyName("group")] + public int? Group { get; set; } + [JsonInclude, JsonPropertyName("pattern")] + public string? Pattern { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "pattern"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PatternTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PatternTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public PatternTokenizerDescriptor() : base() + { + } + + private string? FlagsValue { get; set; } + private int? GroupValue { get; set; } + private string? PatternValue { get; set; } + private string? VersionValue { get; set; } + + public PatternTokenizerDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + public PatternTokenizerDescriptor Group(int? group) + { + GroupValue = group; + return Self; + } + + public PatternTokenizerDescriptor Pattern(string? pattern) + { + PatternValue = pattern; + return Self; + } + + public PatternTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + if (GroupValue.HasValue) + { + writer.WritePropertyName("group"); + writer.WriteNumberValue(GroupValue.Value); + } + + if (!string.IsNullOrEmpty(PatternValue)) + { + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("pattern"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PatternTokenizer IBuildableDescriptor.Build() => new() + { + Flags = FlagsValue, + Group = GroupValue, + Pattern = PatternValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs new file mode 100644 index 00000000000..e6257eb45fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs @@ -0,0 +1,154 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PhoneticTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("encoder")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticEncoder Encoder { get; set; } + [JsonInclude, JsonPropertyName("languageset")] + public ICollection Languageset { get; set; } + [JsonInclude, JsonPropertyName("max_code_len")] + public int? MaxCodeLen { get; set; } + [JsonInclude, JsonPropertyName("name_type")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticNameType NameType { get; set; } + [JsonInclude, JsonPropertyName("replace")] + public bool? Replace { get; set; } + [JsonInclude, JsonPropertyName("rule_type")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticRuleType RuleType { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "phonetic"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PhoneticTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PhoneticTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public PhoneticTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticEncoder EncoderValue { get; set; } + private ICollection LanguagesetValue { get; set; } + private int? MaxCodeLenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticNameType NameTypeValue { get; set; } + private bool? ReplaceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticRuleType RuleTypeValue { get; set; } + private string? VersionValue { get; set; } + + public PhoneticTokenFilterDescriptor Encoder(Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticEncoder encoder) + { + EncoderValue = encoder; + return Self; + } + + public PhoneticTokenFilterDescriptor Languageset(ICollection languageset) + { + LanguagesetValue = languageset; + return Self; + } + + public PhoneticTokenFilterDescriptor MaxCodeLen(int? maxCodeLen) + { + MaxCodeLenValue = maxCodeLen; + return Self; + } + + public PhoneticTokenFilterDescriptor NameType(Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticNameType nameType) + { + NameTypeValue = nameType; + return Self; + } + + public PhoneticTokenFilterDescriptor Replace(bool? replace = true) + { + ReplaceValue = replace; + return Self; + } + + public PhoneticTokenFilterDescriptor RuleType(Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticRuleType ruleType) + { + RuleTypeValue = ruleType; + return Self; + } + + public PhoneticTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("encoder"); + JsonSerializer.Serialize(writer, EncoderValue, options); + writer.WritePropertyName("languageset"); + JsonSerializer.Serialize(writer, LanguagesetValue, options); + if (MaxCodeLenValue.HasValue) + { + writer.WritePropertyName("max_code_len"); + writer.WriteNumberValue(MaxCodeLenValue.Value); + } + + writer.WritePropertyName("name_type"); + JsonSerializer.Serialize(writer, NameTypeValue, options); + if (ReplaceValue.HasValue) + { + writer.WritePropertyName("replace"); + writer.WriteBooleanValue(ReplaceValue.Value); + } + + writer.WritePropertyName("rule_type"); + JsonSerializer.Serialize(writer, RuleTypeValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("phonetic"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PhoneticTokenFilter IBuildableDescriptor.Build() => new() + { + Encoder = EncoderValue, + Languageset = LanguagesetValue, + MaxCodeLen = MaxCodeLenValue, + NameType = NameTypeValue, + Replace = ReplaceValue, + RuleType = RuleTypeValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs new file mode 100644 index 00000000000..e6ae822fc8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PorterStemTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "porter_stem"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PorterStemTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PorterStemTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public PorterStemTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public PorterStemTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("porter_stem"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PorterStemTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs new file mode 100644 index 00000000000..a01a430bd1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class PredicateTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "predicate_token_filter"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class PredicateTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PredicateTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public PredicateTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + private string? VersionValue { get; set; } + + public PredicateTokenFilterDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + public PredicateTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("predicate_token_filter"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + PredicateTokenFilter IBuildableDescriptor.Build() => new() + { + Script = ScriptValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs new file mode 100644 index 00000000000..91d1152064b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class RemoveDuplicatesTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "remove_duplicates"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class RemoveDuplicatesTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal RemoveDuplicatesTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public RemoveDuplicatesTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public RemoveDuplicatesTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("remove_duplicates"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + RemoveDuplicatesTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs new file mode 100644 index 00000000000..75b076aed51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class ReverseTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "reverse"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class ReverseTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ReverseTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public ReverseTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public ReverseTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("reverse"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + ReverseTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs new file mode 100644 index 00000000000..14cc8b83fb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class ShingleTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("filler_token")] + public string? FillerToken { get; set; } + [JsonInclude, JsonPropertyName("max_shingle_size")] + public Union? MaxShingleSize { get; set; } + [JsonInclude, JsonPropertyName("min_shingle_size")] + public Union? MinShingleSize { get; set; } + [JsonInclude, JsonPropertyName("output_unigrams")] + public bool? OutputUnigrams { get; set; } + [JsonInclude, JsonPropertyName("output_unigrams_if_no_shingles")] + public bool? OutputUnigramsIfNoShingles { get; set; } + [JsonInclude, JsonPropertyName("token_separator")] + public string? TokenSeparator { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "shingle"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class ShingleTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ShingleTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public ShingleTokenFilterDescriptor() : base() + { + } + + private string? FillerTokenValue { get; set; } + private Union? MaxShingleSizeValue { get; set; } + private Union? MinShingleSizeValue { get; set; } + private bool? OutputUnigramsValue { get; set; } + private bool? OutputUnigramsIfNoShinglesValue { get; set; } + private string? TokenSeparatorValue { get; set; } + private string? VersionValue { get; set; } + + public ShingleTokenFilterDescriptor FillerToken(string? fillerToken) + { + FillerTokenValue = fillerToken; + return Self; + } + + public ShingleTokenFilterDescriptor MaxShingleSize(Union? maxShingleSize) + { + MaxShingleSizeValue = maxShingleSize; + return Self; + } + + public ShingleTokenFilterDescriptor MinShingleSize(Union? minShingleSize) + { + MinShingleSizeValue = minShingleSize; + return Self; + } + + public ShingleTokenFilterDescriptor OutputUnigrams(bool? outputUnigrams = true) + { + OutputUnigramsValue = outputUnigrams; + return Self; + } + + public ShingleTokenFilterDescriptor OutputUnigramsIfNoShingles(bool? outputUnigramsIfNoShingles = true) + { + OutputUnigramsIfNoShinglesValue = outputUnigramsIfNoShingles; + return Self; + } + + public ShingleTokenFilterDescriptor TokenSeparator(string? tokenSeparator) + { + TokenSeparatorValue = tokenSeparator; + return Self; + } + + public ShingleTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FillerTokenValue)) + { + writer.WritePropertyName("filler_token"); + writer.WriteStringValue(FillerTokenValue); + } + + if (MaxShingleSizeValue is not null) + { + writer.WritePropertyName("max_shingle_size"); + JsonSerializer.Serialize(writer, MaxShingleSizeValue, options); + } + + if (MinShingleSizeValue is not null) + { + writer.WritePropertyName("min_shingle_size"); + JsonSerializer.Serialize(writer, MinShingleSizeValue, options); + } + + if (OutputUnigramsValue.HasValue) + { + writer.WritePropertyName("output_unigrams"); + writer.WriteBooleanValue(OutputUnigramsValue.Value); + } + + if (OutputUnigramsIfNoShinglesValue.HasValue) + { + writer.WritePropertyName("output_unigrams_if_no_shingles"); + writer.WriteBooleanValue(OutputUnigramsIfNoShinglesValue.Value); + } + + if (!string.IsNullOrEmpty(TokenSeparatorValue)) + { + writer.WritePropertyName("token_separator"); + writer.WriteStringValue(TokenSeparatorValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("shingle"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + ShingleTokenFilter IBuildableDescriptor.Build() => new() + { + FillerToken = FillerTokenValue, + MaxShingleSize = MaxShingleSizeValue, + MinShingleSize = MinShingleSizeValue, + OutputUnigrams = OutputUnigramsValue, + OutputUnigramsIfNoShingles = OutputUnigramsIfNoShinglesValue, + TokenSeparator = TokenSeparatorValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs new file mode 100644 index 00000000000..1517f67f4d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class SimpleAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "simple"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class SimpleAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SimpleAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public SimpleAnalyzerDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public SimpleAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("simple"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + SimpleAnalyzer IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs new file mode 100644 index 00000000000..270ca087833 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class SnowballAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("language")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage Language { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "snowball"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class SnowballAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SnowballAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public SnowballAnalyzerDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage LanguageValue { get; set; } + private ICollection? StopwordsValue { get; set; } + private string? VersionValue { get; set; } + + public SnowballAnalyzerDescriptor Language(Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage language) + { + LanguageValue = language; + return Self; + } + + public SnowballAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public SnowballAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("language"); + JsonSerializer.Serialize(writer, LanguageValue, options); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("snowball"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + SnowballAnalyzer IBuildableDescriptor.Build() => new() + { + Language = LanguageValue, + Stopwords = StopwordsValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs new file mode 100644 index 00000000000..c9b5b9471f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class SnowballTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("language")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage Language { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "snowball"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class SnowballTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SnowballTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public SnowballTokenFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage LanguageValue { get; set; } + private string? VersionValue { get; set; } + + public SnowballTokenFilterDescriptor Language(Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballLanguage language) + { + LanguageValue = language; + return Self; + } + + public SnowballTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("language"); + JsonSerializer.Serialize(writer, LanguageValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("snowball"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + SnowballTokenFilter IBuildableDescriptor.Build() => new() + { + Language = LanguageValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs new file mode 100644 index 00000000000..ed175210241 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class StandardAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("max_token_length")] + public int? MaxTokenLength { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "standard"; +} + +public sealed partial class StandardAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StandardAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public StandardAnalyzerDescriptor() : base() + { + } + + private int? MaxTokenLengthValue { get; set; } + private ICollection? StopwordsValue { get; set; } + + public StandardAnalyzerDescriptor MaxTokenLength(int? maxTokenLength) + { + MaxTokenLengthValue = maxTokenLength; + return Self; + } + + public StandardAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenLengthValue.HasValue) + { + writer.WritePropertyName("max_token_length"); + writer.WriteNumberValue(MaxTokenLengthValue.Value); + } + + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("standard"); + writer.WriteEndObject(); + } + + StandardAnalyzer IBuildableDescriptor.Build() => new() + { + MaxTokenLength = MaxTokenLengthValue, + Stopwords = StopwordsValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs new file mode 100644 index 00000000000..e13a3926e48 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class StandardTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("max_token_length")] + public int? MaxTokenLength { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "standard"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class StandardTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StandardTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public StandardTokenizerDescriptor() : base() + { + } + + private int? MaxTokenLengthValue { get; set; } + private string? VersionValue { get; set; } + + public StandardTokenizerDescriptor MaxTokenLength(int? maxTokenLength) + { + MaxTokenLengthValue = maxTokenLength; + return Self; + } + + public StandardTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenLengthValue.HasValue) + { + writer.WritePropertyName("max_token_length"); + writer.WriteNumberValue(MaxTokenLengthValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("standard"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + StandardTokenizer IBuildableDescriptor.Build() => new() + { + MaxTokenLength = MaxTokenLengthValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs new file mode 100644 index 00000000000..762e21b146a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class StemmerOverrideTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("rules")] + public ICollection? Rules { get; set; } + [JsonInclude, JsonPropertyName("rules_path")] + public string? RulesPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "stemmer_override"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class StemmerOverrideTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StemmerOverrideTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public StemmerOverrideTokenFilterDescriptor() : base() + { + } + + private ICollection? RulesValue { get; set; } + private string? RulesPathValue { get; set; } + private string? VersionValue { get; set; } + + public StemmerOverrideTokenFilterDescriptor Rules(ICollection? rules) + { + RulesValue = rules; + return Self; + } + + public StemmerOverrideTokenFilterDescriptor RulesPath(string? rulesPath) + { + RulesPathValue = rulesPath; + return Self; + } + + public StemmerOverrideTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RulesValue is not null) + { + writer.WritePropertyName("rules"); + JsonSerializer.Serialize(writer, RulesValue, options); + } + + if (!string.IsNullOrEmpty(RulesPathValue)) + { + writer.WritePropertyName("rules_path"); + writer.WriteStringValue(RulesPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("stemmer_override"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + StemmerOverrideTokenFilter IBuildableDescriptor.Build() => new() + { + Rules = RulesValue, + RulesPath = RulesPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs new file mode 100644 index 00000000000..2554b67865a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +internal sealed partial class StemmerTokenFilterConverter : JsonConverter +{ + public override StemmerTokenFilter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new StemmerTokenFilter(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "language" || property == "name") + { + variant.Language = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, StemmerTokenFilter value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Language)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(value.Language); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("stemmer"); + if (value.Version is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, value.Version, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(StemmerTokenFilterConverter))] +public sealed partial class StemmerTokenFilter : ITokenFilter +{ + public string? Language { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "stemmer"; + + public string? Version { get; set; } +} + +public sealed partial class StemmerTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StemmerTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public StemmerTokenFilterDescriptor() : base() + { + } + + private string? LanguageValue { get; set; } + private string? VersionValue { get; set; } + + public StemmerTokenFilterDescriptor Language(string? language) + { + LanguageValue = language; + return Self; + } + + public StemmerTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LanguageValue)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(LanguageValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("stemmer"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + StemmerTokenFilter IBuildableDescriptor.Build() => new() + { + Language = LanguageValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs new file mode 100644 index 00000000000..433ac057d9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class StopAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + [JsonInclude, JsonPropertyName("stopwords_path")] + public string? StopwordsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "stop"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class StopAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StopAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public StopAnalyzerDescriptor() : base() + { + } + + private ICollection? StopwordsValue { get; set; } + private string? StopwordsPathValue { get; set; } + private string? VersionValue { get; set; } + + public StopAnalyzerDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public StopAnalyzerDescriptor StopwordsPath(string? stopwordsPath) + { + StopwordsPathValue = stopwordsPath; + return Self; + } + + public StopAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + if (!string.IsNullOrEmpty(StopwordsPathValue)) + { + writer.WritePropertyName("stopwords_path"); + writer.WriteStringValue(StopwordsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("stop"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + StopAnalyzer IBuildableDescriptor.Build() => new() + { + Stopwords = StopwordsValue, + StopwordsPath = StopwordsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs new file mode 100644 index 00000000000..0071fe4984e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class StopTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("ignore_case")] + public bool? IgnoreCase { get; set; } + [JsonInclude, JsonPropertyName("remove_trailing")] + public bool? RemoveTrailing { get; set; } + [JsonInclude, JsonPropertyName("stopwords")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? Stopwords { get; set; } + [JsonInclude, JsonPropertyName("stopwords_path")] + public string? StopwordsPath { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "stop"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class StopTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal StopTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public StopTokenFilterDescriptor() : base() + { + } + + private bool? IgnoreCaseValue { get; set; } + private bool? RemoveTrailingValue { get; set; } + private ICollection? StopwordsValue { get; set; } + private string? StopwordsPathValue { get; set; } + private string? VersionValue { get; set; } + + public StopTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) + { + IgnoreCaseValue = ignoreCase; + return Self; + } + + public StopTokenFilterDescriptor RemoveTrailing(bool? removeTrailing = true) + { + RemoveTrailingValue = removeTrailing; + return Self; + } + + public StopTokenFilterDescriptor Stopwords(ICollection? stopwords) + { + StopwordsValue = stopwords; + return Self; + } + + public StopTokenFilterDescriptor StopwordsPath(string? stopwordsPath) + { + StopwordsPathValue = stopwordsPath; + return Self; + } + + public StopTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IgnoreCaseValue.HasValue) + { + writer.WritePropertyName("ignore_case"); + writer.WriteBooleanValue(IgnoreCaseValue.Value); + } + + if (RemoveTrailingValue.HasValue) + { + writer.WritePropertyName("remove_trailing"); + writer.WriteBooleanValue(RemoveTrailingValue.Value); + } + + if (StopwordsValue is not null) + { + writer.WritePropertyName("stopwords"); + SingleOrManySerializationHelper.Serialize(StopwordsValue, writer, options); + } + + if (!string.IsNullOrEmpty(StopwordsPathValue)) + { + writer.WritePropertyName("stopwords_path"); + writer.WriteStringValue(StopwordsPathValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("stop"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + StopTokenFilter IBuildableDescriptor.Build() => new() + { + IgnoreCase = IgnoreCaseValue, + RemoveTrailing = RemoveTrailingValue, + Stopwords = StopwordsValue, + StopwordsPath = StopwordsPathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs new file mode 100644 index 00000000000..a64c34f211a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class SynonymGraphTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("expand")] + public bool? Expand { get; set; } + [JsonInclude, JsonPropertyName("format")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? Format { get; set; } + [JsonInclude, JsonPropertyName("lenient")] + public bool? Lenient { get; set; } + [JsonInclude, JsonPropertyName("synonyms")] + public ICollection? Synonyms { get; set; } + [JsonInclude, JsonPropertyName("synonyms_path")] + public string? SynonymsPath { get; set; } + [JsonInclude, JsonPropertyName("tokenizer")] + public string? Tokenizer { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "synonym_graph"; + + [JsonInclude, JsonPropertyName("updateable")] + public bool? Updateable { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class SynonymGraphTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SynonymGraphTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public SynonymGraphTokenFilterDescriptor() : base() + { + } + + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? FormatValue { get; set; } + private bool? LenientValue { get; set; } + private ICollection? SynonymsValue { get; set; } + private string? SynonymsPathValue { get; set; } + private string? TokenizerValue { get; set; } + private bool? UpdateableValue { get; set; } + private string? VersionValue { get; set; } + + public SynonymGraphTokenFilterDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Format(Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? format) + { + FormatValue = format; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Synonyms(ICollection? synonyms) + { + SynonymsValue = synonyms; + return Self; + } + + public SynonymGraphTokenFilterDescriptor SynonymsPath(string? synonymsPath) + { + SynonymsPathValue = synonymsPath; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Tokenizer(string? tokenizer) + { + TokenizerValue = tokenizer; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Updateable(bool? updateable = true) + { + UpdateableValue = updateable; + return Self; + } + + public SynonymGraphTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (SynonymsValue is not null) + { + writer.WritePropertyName("synonyms"); + JsonSerializer.Serialize(writer, SynonymsValue, options); + } + + if (!string.IsNullOrEmpty(SynonymsPathValue)) + { + writer.WritePropertyName("synonyms_path"); + writer.WriteStringValue(SynonymsPathValue); + } + + if (!string.IsNullOrEmpty(TokenizerValue)) + { + writer.WritePropertyName("tokenizer"); + writer.WriteStringValue(TokenizerValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("synonym_graph"); + if (UpdateableValue.HasValue) + { + writer.WritePropertyName("updateable"); + writer.WriteBooleanValue(UpdateableValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + SynonymGraphTokenFilter IBuildableDescriptor.Build() => new() + { + Expand = ExpandValue, + Format = FormatValue, + Lenient = LenientValue, + Synonyms = SynonymsValue, + SynonymsPath = SynonymsPathValue, + Tokenizer = TokenizerValue, + Updateable = UpdateableValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs new file mode 100644 index 00000000000..f6803ba5afe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class SynonymTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("expand")] + public bool? Expand { get; set; } + [JsonInclude, JsonPropertyName("format")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? Format { get; set; } + [JsonInclude, JsonPropertyName("lenient")] + public bool? Lenient { get; set; } + [JsonInclude, JsonPropertyName("synonyms")] + public ICollection? Synonyms { get; set; } + [JsonInclude, JsonPropertyName("synonyms_path")] + public string? SynonymsPath { get; set; } + [JsonInclude, JsonPropertyName("tokenizer")] + public string? Tokenizer { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "synonym"; + + [JsonInclude, JsonPropertyName("updateable")] + public bool? Updateable { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class SynonymTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SynonymTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public SynonymTokenFilterDescriptor() : base() + { + } + + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? FormatValue { get; set; } + private bool? LenientValue { get; set; } + private ICollection? SynonymsValue { get; set; } + private string? SynonymsPathValue { get; set; } + private string? TokenizerValue { get; set; } + private bool? UpdateableValue { get; set; } + private string? VersionValue { get; set; } + + public SynonymTokenFilterDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public SynonymTokenFilterDescriptor Format(Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymFormat? format) + { + FormatValue = format; + return Self; + } + + public SynonymTokenFilterDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + public SynonymTokenFilterDescriptor Synonyms(ICollection? synonyms) + { + SynonymsValue = synonyms; + return Self; + } + + public SynonymTokenFilterDescriptor SynonymsPath(string? synonymsPath) + { + SynonymsPathValue = synonymsPath; + return Self; + } + + public SynonymTokenFilterDescriptor Tokenizer(string? tokenizer) + { + TokenizerValue = tokenizer; + return Self; + } + + public SynonymTokenFilterDescriptor Updateable(bool? updateable = true) + { + UpdateableValue = updateable; + return Self; + } + + public SynonymTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (SynonymsValue is not null) + { + writer.WritePropertyName("synonyms"); + JsonSerializer.Serialize(writer, SynonymsValue, options); + } + + if (!string.IsNullOrEmpty(SynonymsPathValue)) + { + writer.WritePropertyName("synonyms_path"); + writer.WriteStringValue(SynonymsPathValue); + } + + if (!string.IsNullOrEmpty(TokenizerValue)) + { + writer.WritePropertyName("tokenizer"); + writer.WriteStringValue(TokenizerValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("synonym"); + if (UpdateableValue.HasValue) + { + writer.WritePropertyName("updateable"); + writer.WriteBooleanValue(UpdateableValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + SynonymTokenFilter IBuildableDescriptor.Build() => new() + { + Expand = ExpandValue, + Format = FormatValue, + Lenient = LenientValue, + Synonyms = SynonymsValue, + SynonymsPath = SynonymsPathValue, + Tokenizer = TokenizerValue, + Updateable = UpdateableValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs new file mode 100644 index 00000000000..f0272e0e8d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs @@ -0,0 +1,497 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public partial class TokenFilters : IsADictionary +{ + public TokenFilters() + { + } + + public TokenFilters(IDictionary container) : base(container) + { + } + + public void Add(string name, ITokenFilter tokenFilter) => BackingDictionary.Add(Sanitize(name), tokenFilter); + public bool TryGetTokenFilter(string name, [NotNullWhen(returnValue: true)] out ITokenFilter tokenFilter) => BackingDictionary.TryGetValue(Sanitize(name), out tokenFilter); + + public bool TryGetTokenFilter(string name, [NotNullWhen(returnValue: true)] out T? tokenFilter) where T : class, ITokenFilter + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + tokenFilter = finalValue; + return true; + } + + tokenFilter = null; + return false; + } +} + +public sealed partial class TokenFiltersDescriptor : IsADictionaryDescriptor +{ + public TokenFiltersDescriptor() : base(new TokenFilters()) + { + } + + public TokenFiltersDescriptor(TokenFilters tokenFilters) : base(tokenFilters ?? new TokenFilters()) + { + } + + public TokenFiltersDescriptor AsciiFolding(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor AsciiFolding(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor AsciiFolding(string tokenFilterName, AsciiFoldingTokenFilter asciiFoldingTokenFilter) => AssignVariant(tokenFilterName, asciiFoldingTokenFilter); + public TokenFiltersDescriptor CommonGrams(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor CommonGrams(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor CommonGrams(string tokenFilterName, CommonGramsTokenFilter commonGramsTokenFilter) => AssignVariant(tokenFilterName, commonGramsTokenFilter); + public TokenFiltersDescriptor Condition(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Condition(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Condition(string tokenFilterName, ConditionTokenFilter conditionTokenFilter) => AssignVariant(tokenFilterName, conditionTokenFilter); + public TokenFiltersDescriptor DelimitedPayload(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor DelimitedPayload(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor DelimitedPayload(string tokenFilterName, DelimitedPayloadTokenFilter delimitedPayloadTokenFilter) => AssignVariant(tokenFilterName, delimitedPayloadTokenFilter); + public TokenFiltersDescriptor DictionaryDecompounder(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor DictionaryDecompounder(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor DictionaryDecompounder(string tokenFilterName, DictionaryDecompounderTokenFilter dictionaryDecompounderTokenFilter) => AssignVariant(tokenFilterName, dictionaryDecompounderTokenFilter); + public TokenFiltersDescriptor EdgeNGram(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor EdgeNGram(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor EdgeNGram(string tokenFilterName, EdgeNGramTokenFilter edgeNGramTokenFilter) => AssignVariant(tokenFilterName, edgeNGramTokenFilter); + public TokenFiltersDescriptor Elision(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Elision(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Elision(string tokenFilterName, ElisionTokenFilter elisionTokenFilter) => AssignVariant(tokenFilterName, elisionTokenFilter); + public TokenFiltersDescriptor Fingerprint(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Fingerprint(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Fingerprint(string tokenFilterName, FingerprintTokenFilter fingerprintTokenFilter) => AssignVariant(tokenFilterName, fingerprintTokenFilter); + public TokenFiltersDescriptor Hunspell(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Hunspell(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Hunspell(string tokenFilterName, HunspellTokenFilter hunspellTokenFilter) => AssignVariant(tokenFilterName, hunspellTokenFilter); + public TokenFiltersDescriptor HyphenationDecompounder(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor HyphenationDecompounder(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor HyphenationDecompounder(string tokenFilterName, HyphenationDecompounderTokenFilter hyphenationDecompounderTokenFilter) => AssignVariant(tokenFilterName, hyphenationDecompounderTokenFilter); + public TokenFiltersDescriptor IcuCollation(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor IcuCollation(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor IcuCollation(string tokenFilterName, IcuCollationTokenFilter icuCollationTokenFilter) => AssignVariant(tokenFilterName, icuCollationTokenFilter); + public TokenFiltersDescriptor IcuFolding(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor IcuFolding(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor IcuFolding(string tokenFilterName, IcuFoldingTokenFilter icuFoldingTokenFilter) => AssignVariant(tokenFilterName, icuFoldingTokenFilter); + public TokenFiltersDescriptor IcuNormalization(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor IcuNormalization(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor IcuNormalization(string tokenFilterName, IcuNormalizationTokenFilter icuNormalizationTokenFilter) => AssignVariant(tokenFilterName, icuNormalizationTokenFilter); + public TokenFiltersDescriptor IcuTokenizer(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor IcuTokenizer(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor IcuTokenizer(string tokenFilterName, IcuTokenizer icuTokenizer) => AssignVariant(tokenFilterName, icuTokenizer); + public TokenFiltersDescriptor IcuTransform(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor IcuTransform(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor IcuTransform(string tokenFilterName, IcuTransformTokenFilter icuTransformTokenFilter) => AssignVariant(tokenFilterName, icuTransformTokenFilter); + public TokenFiltersDescriptor KeepTypes(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KeepTypes(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KeepTypes(string tokenFilterName, KeepTypesTokenFilter keepTypesTokenFilter) => AssignVariant(tokenFilterName, keepTypesTokenFilter); + public TokenFiltersDescriptor KeepWords(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KeepWords(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KeepWords(string tokenFilterName, KeepWordsTokenFilter keepWordsTokenFilter) => AssignVariant(tokenFilterName, keepWordsTokenFilter); + public TokenFiltersDescriptor KeywordMarker(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KeywordMarker(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KeywordMarker(string tokenFilterName, KeywordMarkerTokenFilter keywordMarkerTokenFilter) => AssignVariant(tokenFilterName, keywordMarkerTokenFilter); + public TokenFiltersDescriptor KStem(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KStem(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KStem(string tokenFilterName, KStemTokenFilter kStemTokenFilter) => AssignVariant(tokenFilterName, kStemTokenFilter); + public TokenFiltersDescriptor KuromojiPartOfSpeech(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KuromojiPartOfSpeech(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KuromojiPartOfSpeech(string tokenFilterName, KuromojiPartOfSpeechTokenFilter kuromojiPartOfSpeechTokenFilter) => AssignVariant(tokenFilterName, kuromojiPartOfSpeechTokenFilter); + public TokenFiltersDescriptor KuromojiReadingForm(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KuromojiReadingForm(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KuromojiReadingForm(string tokenFilterName, KuromojiReadingFormTokenFilter kuromojiReadingFormTokenFilter) => AssignVariant(tokenFilterName, kuromojiReadingFormTokenFilter); + public TokenFiltersDescriptor KuromojiStemmer(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor KuromojiStemmer(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor KuromojiStemmer(string tokenFilterName, KuromojiStemmerTokenFilter kuromojiStemmerTokenFilter) => AssignVariant(tokenFilterName, kuromojiStemmerTokenFilter); + public TokenFiltersDescriptor Length(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Length(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Length(string tokenFilterName, LengthTokenFilter lengthTokenFilter) => AssignVariant(tokenFilterName, lengthTokenFilter); + public TokenFiltersDescriptor LimitTokenCount(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor LimitTokenCount(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor LimitTokenCount(string tokenFilterName, LimitTokenCountTokenFilter limitTokenCountTokenFilter) => AssignVariant(tokenFilterName, limitTokenCountTokenFilter); + public TokenFiltersDescriptor Lowercase(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Lowercase(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Lowercase(string tokenFilterName, LowercaseTokenFilter lowercaseTokenFilter) => AssignVariant(tokenFilterName, lowercaseTokenFilter); + public TokenFiltersDescriptor Multiplexer(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Multiplexer(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Multiplexer(string tokenFilterName, MultiplexerTokenFilter multiplexerTokenFilter) => AssignVariant(tokenFilterName, multiplexerTokenFilter); + public TokenFiltersDescriptor NGram(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor NGram(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor NGram(string tokenFilterName, NGramTokenFilter nGramTokenFilter) => AssignVariant(tokenFilterName, nGramTokenFilter); + public TokenFiltersDescriptor NoriPartOfSpeech(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor NoriPartOfSpeech(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor NoriPartOfSpeech(string tokenFilterName, NoriPartOfSpeechTokenFilter noriPartOfSpeechTokenFilter) => AssignVariant(tokenFilterName, noriPartOfSpeechTokenFilter); + public TokenFiltersDescriptor PatternCapture(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor PatternCapture(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor PatternCapture(string tokenFilterName, PatternCaptureTokenFilter patternCaptureTokenFilter) => AssignVariant(tokenFilterName, patternCaptureTokenFilter); + public TokenFiltersDescriptor PatternReplace(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor PatternReplace(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor PatternReplace(string tokenFilterName, PatternReplaceTokenFilter patternReplaceTokenFilter) => AssignVariant(tokenFilterName, patternReplaceTokenFilter); + public TokenFiltersDescriptor Phonetic(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Phonetic(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Phonetic(string tokenFilterName, PhoneticTokenFilter phoneticTokenFilter) => AssignVariant(tokenFilterName, phoneticTokenFilter); + public TokenFiltersDescriptor PorterStem(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor PorterStem(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor PorterStem(string tokenFilterName, PorterStemTokenFilter porterStemTokenFilter) => AssignVariant(tokenFilterName, porterStemTokenFilter); + public TokenFiltersDescriptor Predicate(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Predicate(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Predicate(string tokenFilterName, PredicateTokenFilter predicateTokenFilter) => AssignVariant(tokenFilterName, predicateTokenFilter); + public TokenFiltersDescriptor RemoveDuplicates(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor RemoveDuplicates(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor RemoveDuplicates(string tokenFilterName, RemoveDuplicatesTokenFilter removeDuplicatesTokenFilter) => AssignVariant(tokenFilterName, removeDuplicatesTokenFilter); + public TokenFiltersDescriptor Reverse(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Reverse(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Reverse(string tokenFilterName, ReverseTokenFilter reverseTokenFilter) => AssignVariant(tokenFilterName, reverseTokenFilter); + public TokenFiltersDescriptor Shingle(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Shingle(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Shingle(string tokenFilterName, ShingleTokenFilter shingleTokenFilter) => AssignVariant(tokenFilterName, shingleTokenFilter); + public TokenFiltersDescriptor Snowball(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Snowball(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Snowball(string tokenFilterName, SnowballTokenFilter snowballTokenFilter) => AssignVariant(tokenFilterName, snowballTokenFilter); + public TokenFiltersDescriptor StemmerOverride(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor StemmerOverride(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor StemmerOverride(string tokenFilterName, StemmerOverrideTokenFilter stemmerOverrideTokenFilter) => AssignVariant(tokenFilterName, stemmerOverrideTokenFilter); + public TokenFiltersDescriptor Stemmer(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Stemmer(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Stemmer(string tokenFilterName, StemmerTokenFilter stemmerTokenFilter) => AssignVariant(tokenFilterName, stemmerTokenFilter); + public TokenFiltersDescriptor Stop(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Stop(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Stop(string tokenFilterName, StopTokenFilter stopTokenFilter) => AssignVariant(tokenFilterName, stopTokenFilter); + public TokenFiltersDescriptor SynonymGraph(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor SynonymGraph(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor SynonymGraph(string tokenFilterName, SynonymGraphTokenFilter synonymGraphTokenFilter) => AssignVariant(tokenFilterName, synonymGraphTokenFilter); + public TokenFiltersDescriptor Synonym(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Synonym(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Synonym(string tokenFilterName, SynonymTokenFilter synonymTokenFilter) => AssignVariant(tokenFilterName, synonymTokenFilter); + public TokenFiltersDescriptor Trim(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Trim(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Trim(string tokenFilterName, TrimTokenFilter trimTokenFilter) => AssignVariant(tokenFilterName, trimTokenFilter); + public TokenFiltersDescriptor Truncate(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Truncate(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Truncate(string tokenFilterName, TruncateTokenFilter truncateTokenFilter) => AssignVariant(tokenFilterName, truncateTokenFilter); + public TokenFiltersDescriptor Unique(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Unique(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Unique(string tokenFilterName, UniqueTokenFilter uniqueTokenFilter) => AssignVariant(tokenFilterName, uniqueTokenFilter); + public TokenFiltersDescriptor Uppercase(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor Uppercase(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor Uppercase(string tokenFilterName, UppercaseTokenFilter uppercaseTokenFilter) => AssignVariant(tokenFilterName, uppercaseTokenFilter); + public TokenFiltersDescriptor WordDelimiterGraph(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor WordDelimiterGraph(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor WordDelimiterGraph(string tokenFilterName, WordDelimiterGraphTokenFilter wordDelimiterGraphTokenFilter) => AssignVariant(tokenFilterName, wordDelimiterGraphTokenFilter); + public TokenFiltersDescriptor WordDelimiter(string tokenFilterName) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, WordDelimiterTokenFilter wordDelimiterTokenFilter) => AssignVariant(tokenFilterName, wordDelimiterTokenFilter); +} + +internal sealed partial class TokenFilterInterfaceConverter : JsonConverter +{ + public override ITokenFilter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "dictionary_decompounder": + return JsonSerializer.Deserialize(ref reader, options); + case "phonetic": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_transform": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_normalizer": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_folding": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_collation": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_part_of_speech": + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_readingform": + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_stemmer": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "uppercase": + return JsonSerializer.Deserialize(ref reader, options); + case "unique": + return JsonSerializer.Deserialize(ref reader, options); + case "truncate": + return JsonSerializer.Deserialize(ref reader, options); + case "trim": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer_override": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "shingle": + return JsonSerializer.Deserialize(ref reader, options); + case "reverse": + return JsonSerializer.Deserialize(ref reader, options); + case "remove_duplicates": + return JsonSerializer.Deserialize(ref reader, options); + case "predicate_token_filter": + return JsonSerializer.Deserialize(ref reader, options); + case "porter_stem": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_capture": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_part_of_speech": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "multiplexer": + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "limit": + return JsonSerializer.Deserialize(ref reader, options); + case "length": + return JsonSerializer.Deserialize(ref reader, options); + case "kstem": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword_marker": + return JsonSerializer.Deserialize(ref reader, options); + case "keep": + return JsonSerializer.Deserialize(ref reader, options); + case "keep_types": + return JsonSerializer.Deserialize(ref reader, options); + case "hyphenation_decompounder": + return JsonSerializer.Deserialize(ref reader, options); + case "hunspell": + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + return JsonSerializer.Deserialize(ref reader, options); + case "elision": + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "delimited_payload": + return JsonSerializer.Deserialize(ref reader, options); + case "condition": + return JsonSerializer.Deserialize(ref reader, options); + case "common_grams": + return JsonSerializer.Deserialize(ref reader, options); + case "asciifolding": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenFilter)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, ITokenFilter value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "dictionary_decompounder": + JsonSerializer.Serialize(writer, value, typeof(DictionaryDecompounderTokenFilter), options); + return; + case "phonetic": + JsonSerializer.Serialize(writer, value, typeof(PhoneticTokenFilter), options); + return; + case "icu_transform": + JsonSerializer.Serialize(writer, value, typeof(IcuTransformTokenFilter), options); + return; + case "icu_normalizer": + JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationTokenFilter), options); + return; + case "icu_folding": + JsonSerializer.Serialize(writer, value, typeof(IcuFoldingTokenFilter), options); + return; + case "icu_collation": + JsonSerializer.Serialize(writer, value, typeof(IcuCollationTokenFilter), options); + return; + case "icu_tokenizer": + JsonSerializer.Serialize(writer, value, typeof(IcuTokenizer), options); + return; + case "kuromoji_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(KuromojiPartOfSpeechTokenFilter), options); + return; + case "kuromoji_readingform": + JsonSerializer.Serialize(writer, value, typeof(KuromojiReadingFormTokenFilter), options); + return; + case "kuromoji_stemmer": + JsonSerializer.Serialize(writer, value, typeof(KuromojiStemmerTokenFilter), options); + return; + case "word_delimiter": + JsonSerializer.Serialize(writer, value, typeof(WordDelimiterTokenFilter), options); + return; + case "word_delimiter_graph": + JsonSerializer.Serialize(writer, value, typeof(WordDelimiterGraphTokenFilter), options); + return; + case "uppercase": + JsonSerializer.Serialize(writer, value, typeof(UppercaseTokenFilter), options); + return; + case "unique": + JsonSerializer.Serialize(writer, value, typeof(UniqueTokenFilter), options); + return; + case "truncate": + JsonSerializer.Serialize(writer, value, typeof(TruncateTokenFilter), options); + return; + case "trim": + JsonSerializer.Serialize(writer, value, typeof(TrimTokenFilter), options); + return; + case "synonym": + JsonSerializer.Serialize(writer, value, typeof(SynonymTokenFilter), options); + return; + case "synonym_graph": + JsonSerializer.Serialize(writer, value, typeof(SynonymGraphTokenFilter), options); + return; + case "stop": + JsonSerializer.Serialize(writer, value, typeof(StopTokenFilter), options); + return; + case "stemmer": + JsonSerializer.Serialize(writer, value, typeof(StemmerTokenFilter), options); + return; + case "stemmer_override": + JsonSerializer.Serialize(writer, value, typeof(StemmerOverrideTokenFilter), options); + return; + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(SnowballTokenFilter), options); + return; + case "shingle": + JsonSerializer.Serialize(writer, value, typeof(ShingleTokenFilter), options); + return; + case "reverse": + JsonSerializer.Serialize(writer, value, typeof(ReverseTokenFilter), options); + return; + case "remove_duplicates": + JsonSerializer.Serialize(writer, value, typeof(RemoveDuplicatesTokenFilter), options); + return; + case "predicate_token_filter": + JsonSerializer.Serialize(writer, value, typeof(PredicateTokenFilter), options); + return; + case "porter_stem": + JsonSerializer.Serialize(writer, value, typeof(PorterStemTokenFilter), options); + return; + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(PatternReplaceTokenFilter), options); + return; + case "pattern_capture": + JsonSerializer.Serialize(writer, value, typeof(PatternCaptureTokenFilter), options); + return; + case "nori_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(NoriPartOfSpeechTokenFilter), options); + return; + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(NGramTokenFilter), options); + return; + case "multiplexer": + JsonSerializer.Serialize(writer, value, typeof(MultiplexerTokenFilter), options); + return; + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenFilter), options); + return; + case "limit": + JsonSerializer.Serialize(writer, value, typeof(LimitTokenCountTokenFilter), options); + return; + case "length": + JsonSerializer.Serialize(writer, value, typeof(LengthTokenFilter), options); + return; + case "kstem": + JsonSerializer.Serialize(writer, value, typeof(KStemTokenFilter), options); + return; + case "keyword_marker": + JsonSerializer.Serialize(writer, value, typeof(KeywordMarkerTokenFilter), options); + return; + case "keep": + JsonSerializer.Serialize(writer, value, typeof(KeepWordsTokenFilter), options); + return; + case "keep_types": + JsonSerializer.Serialize(writer, value, typeof(KeepTypesTokenFilter), options); + return; + case "hyphenation_decompounder": + JsonSerializer.Serialize(writer, value, typeof(HyphenationDecompounderTokenFilter), options); + return; + case "hunspell": + JsonSerializer.Serialize(writer, value, typeof(HunspellTokenFilter), options); + return; + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(FingerprintTokenFilter), options); + return; + case "elision": + JsonSerializer.Serialize(writer, value, typeof(ElisionTokenFilter), options); + return; + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenFilter), options); + return; + case "delimited_payload": + JsonSerializer.Serialize(writer, value, typeof(DelimitedPayloadTokenFilter), options); + return; + case "condition": + JsonSerializer.Serialize(writer, value, typeof(ConditionTokenFilter), options); + return; + case "common_grams": + JsonSerializer.Serialize(writer, value, typeof(CommonGramsTokenFilter), options); + return; + case "asciifolding": + JsonSerializer.Serialize(writer, value, typeof(AsciiFoldingTokenFilter), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(TokenFilterInterfaceConverter))] +public partial interface ITokenFilter +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs new file mode 100644 index 00000000000..d6a38ff223c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public partial class Tokenizers : IsADictionary +{ + public Tokenizers() + { + } + + public Tokenizers(IDictionary container) : base(container) + { + } + + public void Add(string name, ITokenizer tokenizer) => BackingDictionary.Add(Sanitize(name), tokenizer); + public bool TryGetTokenizer(string name, [NotNullWhen(returnValue: true)] out ITokenizer tokenizer) => BackingDictionary.TryGetValue(Sanitize(name), out tokenizer); + + public bool TryGetTokenizer(string name, [NotNullWhen(returnValue: true)] out T? tokenizer) where T : class, ITokenizer + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + tokenizer = finalValue; + return true; + } + + tokenizer = null; + return false; + } +} + +public sealed partial class TokenizersDescriptor : IsADictionaryDescriptor +{ + public TokenizersDescriptor() : base(new Tokenizers()) + { + } + + public TokenizersDescriptor(Tokenizers tokenizers) : base(tokenizers ?? new Tokenizers()) + { + } + + public TokenizersDescriptor CharGroup(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor CharGroup(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor CharGroup(string tokenizerName, CharGroupTokenizer charGroupTokenizer) => AssignVariant(tokenizerName, charGroupTokenizer); + public TokenizersDescriptor EdgeNGram(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor EdgeNGram(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor EdgeNGram(string tokenizerName, EdgeNGramTokenizer edgeNGramTokenizer) => AssignVariant(tokenizerName, edgeNGramTokenizer); + public TokenizersDescriptor Icu(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Icu(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Icu(string tokenizerName, IcuTokenizer icuTokenizer) => AssignVariant(tokenizerName, icuTokenizer); + public TokenizersDescriptor Keyword(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Keyword(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Keyword(string tokenizerName, KeywordTokenizer keywordTokenizer) => AssignVariant(tokenizerName, keywordTokenizer); + public TokenizersDescriptor Kuromoji(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Kuromoji(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Kuromoji(string tokenizerName, KuromojiTokenizer kuromojiTokenizer) => AssignVariant(tokenizerName, kuromojiTokenizer); + public TokenizersDescriptor Letter(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Letter(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Letter(string tokenizerName, LetterTokenizer letterTokenizer) => AssignVariant(tokenizerName, letterTokenizer); + public TokenizersDescriptor Lowercase(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Lowercase(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Lowercase(string tokenizerName, LowercaseTokenizer lowercaseTokenizer) => AssignVariant(tokenizerName, lowercaseTokenizer); + public TokenizersDescriptor NGram(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor NGram(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor NGram(string tokenizerName, NGramTokenizer nGramTokenizer) => AssignVariant(tokenizerName, nGramTokenizer); + public TokenizersDescriptor Nori(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Nori(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Nori(string tokenizerName, NoriTokenizer noriTokenizer) => AssignVariant(tokenizerName, noriTokenizer); + public TokenizersDescriptor PathHierarchy(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor PathHierarchy(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor PathHierarchy(string tokenizerName, PathHierarchyTokenizer pathHierarchyTokenizer) => AssignVariant(tokenizerName, pathHierarchyTokenizer); + public TokenizersDescriptor Pattern(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Pattern(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Pattern(string tokenizerName, PatternTokenizer patternTokenizer) => AssignVariant(tokenizerName, patternTokenizer); + public TokenizersDescriptor Standard(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Standard(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Standard(string tokenizerName, StandardTokenizer standardTokenizer) => AssignVariant(tokenizerName, standardTokenizer); + public TokenizersDescriptor UaxEmailUrl(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor UaxEmailUrl(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor UaxEmailUrl(string tokenizerName, UaxEmailUrlTokenizer uaxEmailUrlTokenizer) => AssignVariant(tokenizerName, uaxEmailUrlTokenizer); + public TokenizersDescriptor Whitespace(string tokenizerName) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Whitespace(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); + public TokenizersDescriptor Whitespace(string tokenizerName, WhitespaceTokenizer whitespaceTokenizer) => AssignVariant(tokenizerName, whitespaceTokenizer); +} + +internal sealed partial class TokenizerInterfaceConverter : JsonConverter +{ + public override ITokenizer Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "icu_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); + case "uax_url_email": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "path_hierarchy": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "letter": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "char_group": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenizer)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, ITokenizer value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "icu_tokenizer": + JsonSerializer.Serialize(writer, value, typeof(IcuTokenizer), options); + return; + case "pattern": + JsonSerializer.Serialize(writer, value, typeof(PatternTokenizer), options); + return; + case "kuromoji_tokenizer": + JsonSerializer.Serialize(writer, value, typeof(KuromojiTokenizer), options); + return; + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(WhitespaceTokenizer), options); + return; + case "uax_url_email": + JsonSerializer.Serialize(writer, value, typeof(UaxEmailUrlTokenizer), options); + return; + case "standard": + JsonSerializer.Serialize(writer, value, typeof(StandardTokenizer), options); + return; + case "path_hierarchy": + JsonSerializer.Serialize(writer, value, typeof(PathHierarchyTokenizer), options); + return; + case "nori_tokenizer": + JsonSerializer.Serialize(writer, value, typeof(NoriTokenizer), options); + return; + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(NGramTokenizer), options); + return; + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenizer), options); + return; + case "letter": + JsonSerializer.Serialize(writer, value, typeof(LetterTokenizer), options); + return; + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(KeywordTokenizer), options); + return; + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenizer), options); + return; + case "char_group": + JsonSerializer.Serialize(writer, value, typeof(CharGroupTokenizer), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(TokenizerInterfaceConverter))] +public partial interface ITokenizer +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs new file mode 100644 index 00000000000..c6eec0e1351 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class TrimTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "trim"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class TrimTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal TrimTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public TrimTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public TrimTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("trim"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + TrimTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs new file mode 100644 index 00000000000..a68630b539b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class TruncateTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("length")] + public int? Length { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "truncate"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class TruncateTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal TruncateTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public TruncateTokenFilterDescriptor() : base() + { + } + + private int? LengthValue { get; set; } + private string? VersionValue { get; set; } + + public TruncateTokenFilterDescriptor Length(int? length) + { + LengthValue = length; + return Self; + } + + public TruncateTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LengthValue.HasValue) + { + writer.WritePropertyName("length"); + writer.WriteNumberValue(LengthValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("truncate"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + TruncateTokenFilter IBuildableDescriptor.Build() => new() + { + Length = LengthValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs new file mode 100644 index 00000000000..f26c825b5b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class UaxEmailUrlTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("max_token_length")] + public int? MaxTokenLength { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "uax_url_email"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class UaxEmailUrlTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal UaxEmailUrlTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public UaxEmailUrlTokenizerDescriptor() : base() + { + } + + private int? MaxTokenLengthValue { get; set; } + private string? VersionValue { get; set; } + + public UaxEmailUrlTokenizerDescriptor MaxTokenLength(int? maxTokenLength) + { + MaxTokenLengthValue = maxTokenLength; + return Self; + } + + public UaxEmailUrlTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenLengthValue.HasValue) + { + writer.WritePropertyName("max_token_length"); + writer.WriteNumberValue(MaxTokenLengthValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("uax_url_email"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + UaxEmailUrlTokenizer IBuildableDescriptor.Build() => new() + { + MaxTokenLength = MaxTokenLengthValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs new file mode 100644 index 00000000000..34754620f00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class UniqueTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("only_on_same_position")] + public bool? OnlyOnSamePosition { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "unique"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class UniqueTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal UniqueTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public UniqueTokenFilterDescriptor() : base() + { + } + + private bool? OnlyOnSamePositionValue { get; set; } + private string? VersionValue { get; set; } + + public UniqueTokenFilterDescriptor OnlyOnSamePosition(bool? onlyOnSamePosition = true) + { + OnlyOnSamePositionValue = onlyOnSamePosition; + return Self; + } + + public UniqueTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnlyOnSamePositionValue.HasValue) + { + writer.WritePropertyName("only_on_same_position"); + writer.WriteBooleanValue(OnlyOnSamePositionValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("unique"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + UniqueTokenFilter IBuildableDescriptor.Build() => new() + { + OnlyOnSamePosition = OnlyOnSamePositionValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs new file mode 100644 index 00000000000..100d2d678d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class UppercaseTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "uppercase"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class UppercaseTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal UppercaseTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public UppercaseTokenFilterDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public UppercaseTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("uppercase"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + UppercaseTokenFilter IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs new file mode 100644 index 00000000000..efa0d59818e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class WhitespaceAnalyzer : IAnalyzer +{ + [JsonInclude, JsonPropertyName("type")] + public string Type => "whitespace"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class WhitespaceAnalyzerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal WhitespaceAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public WhitespaceAnalyzerDescriptor() : base() + { + } + + private string? VersionValue { get; set; } + + public WhitespaceAnalyzerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue("whitespace"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + WhitespaceAnalyzer IBuildableDescriptor.Build() => new() + { + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs new file mode 100644 index 00000000000..a6b21c991e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class WhitespaceTokenizer : ITokenizer +{ + [JsonInclude, JsonPropertyName("max_token_length")] + public int? MaxTokenLength { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "whitespace"; + + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class WhitespaceTokenizerDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal WhitespaceTokenizerDescriptor(Action configure) => configure.Invoke(this); + + public WhitespaceTokenizerDescriptor() : base() + { + } + + private int? MaxTokenLengthValue { get; set; } + private string? VersionValue { get; set; } + + public WhitespaceTokenizerDescriptor MaxTokenLength(int? maxTokenLength) + { + MaxTokenLengthValue = maxTokenLength; + return Self; + } + + public WhitespaceTokenizerDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenLengthValue.HasValue) + { + writer.WritePropertyName("max_token_length"); + writer.WriteNumberValue(MaxTokenLengthValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("whitespace"); + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + WhitespaceTokenizer IBuildableDescriptor.Build() => new() + { + MaxTokenLength = MaxTokenLengthValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs new file mode 100644 index 00000000000..6a5b37a7ad1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs @@ -0,0 +1,315 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class WordDelimiterGraphTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("adjust_offsets")] + public bool? AdjustOffsets { get; set; } + [JsonInclude, JsonPropertyName("catenate_all")] + public bool? CatenateAll { get; set; } + [JsonInclude, JsonPropertyName("catenate_numbers")] + public bool? CatenateNumbers { get; set; } + [JsonInclude, JsonPropertyName("catenate_words")] + public bool? CatenateWords { get; set; } + [JsonInclude, JsonPropertyName("generate_number_parts")] + public bool? GenerateNumberParts { get; set; } + [JsonInclude, JsonPropertyName("generate_word_parts")] + public bool? GenerateWordParts { get; set; } + [JsonInclude, JsonPropertyName("ignore_keywords")] + public bool? IgnoreKeywords { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + [JsonInclude, JsonPropertyName("protected_words")] + public ICollection? ProtectedWords { get; set; } + [JsonInclude, JsonPropertyName("protected_words_path")] + public string? ProtectedWordsPath { get; set; } + [JsonInclude, JsonPropertyName("split_on_case_change")] + public bool? SplitOnCaseChange { get; set; } + [JsonInclude, JsonPropertyName("split_on_numerics")] + public bool? SplitOnNumerics { get; set; } + [JsonInclude, JsonPropertyName("stem_english_possessive")] + public bool? StemEnglishPossessive { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "word_delimiter_graph"; + + [JsonInclude, JsonPropertyName("type_table")] + public ICollection? TypeTable { get; set; } + [JsonInclude, JsonPropertyName("type_table_path")] + public string? TypeTablePath { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class WordDelimiterGraphTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal WordDelimiterGraphTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public WordDelimiterGraphTokenFilterDescriptor() : base() + { + } + + private bool? AdjustOffsetsValue { get; set; } + private bool? CatenateAllValue { get; set; } + private bool? CatenateNumbersValue { get; set; } + private bool? CatenateWordsValue { get; set; } + private bool? GenerateNumberPartsValue { get; set; } + private bool? GenerateWordPartsValue { get; set; } + private bool? IgnoreKeywordsValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private ICollection? ProtectedWordsValue { get; set; } + private string? ProtectedWordsPathValue { get; set; } + private bool? SplitOnCaseChangeValue { get; set; } + private bool? SplitOnNumericsValue { get; set; } + private bool? StemEnglishPossessiveValue { get; set; } + private ICollection? TypeTableValue { get; set; } + private string? TypeTablePathValue { get; set; } + private string? VersionValue { get; set; } + + public WordDelimiterGraphTokenFilterDescriptor AdjustOffsets(bool? adjustOffsets = true) + { + AdjustOffsetsValue = adjustOffsets; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor CatenateAll(bool? catenateAll = true) + { + CatenateAllValue = catenateAll; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor CatenateNumbers(bool? catenateNumbers = true) + { + CatenateNumbersValue = catenateNumbers; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor CatenateWords(bool? catenateWords = true) + { + CatenateWordsValue = catenateWords; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor GenerateNumberParts(bool? generateNumberParts = true) + { + GenerateNumberPartsValue = generateNumberParts; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor GenerateWordParts(bool? generateWordParts = true) + { + GenerateWordPartsValue = generateWordParts; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor IgnoreKeywords(bool? ignoreKeywords = true) + { + IgnoreKeywordsValue = ignoreKeywords; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor ProtectedWords(ICollection? protectedWords) + { + ProtectedWordsValue = protectedWords; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor ProtectedWordsPath(string? protectedWordsPath) + { + ProtectedWordsPathValue = protectedWordsPath; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor SplitOnCaseChange(bool? splitOnCaseChange = true) + { + SplitOnCaseChangeValue = splitOnCaseChange; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor SplitOnNumerics(bool? splitOnNumerics = true) + { + SplitOnNumericsValue = splitOnNumerics; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor StemEnglishPossessive(bool? stemEnglishPossessive = true) + { + StemEnglishPossessiveValue = stemEnglishPossessive; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor TypeTable(ICollection? typeTable) + { + TypeTableValue = typeTable; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor TypeTablePath(string? typeTablePath) + { + TypeTablePathValue = typeTablePath; + return Self; + } + + public WordDelimiterGraphTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AdjustOffsetsValue.HasValue) + { + writer.WritePropertyName("adjust_offsets"); + writer.WriteBooleanValue(AdjustOffsetsValue.Value); + } + + if (CatenateAllValue.HasValue) + { + writer.WritePropertyName("catenate_all"); + writer.WriteBooleanValue(CatenateAllValue.Value); + } + + if (CatenateNumbersValue.HasValue) + { + writer.WritePropertyName("catenate_numbers"); + writer.WriteBooleanValue(CatenateNumbersValue.Value); + } + + if (CatenateWordsValue.HasValue) + { + writer.WritePropertyName("catenate_words"); + writer.WriteBooleanValue(CatenateWordsValue.Value); + } + + if (GenerateNumberPartsValue.HasValue) + { + writer.WritePropertyName("generate_number_parts"); + writer.WriteBooleanValue(GenerateNumberPartsValue.Value); + } + + if (GenerateWordPartsValue.HasValue) + { + writer.WritePropertyName("generate_word_parts"); + writer.WriteBooleanValue(GenerateWordPartsValue.Value); + } + + if (IgnoreKeywordsValue.HasValue) + { + writer.WritePropertyName("ignore_keywords"); + writer.WriteBooleanValue(IgnoreKeywordsValue.Value); + } + + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + if (ProtectedWordsValue is not null) + { + writer.WritePropertyName("protected_words"); + JsonSerializer.Serialize(writer, ProtectedWordsValue, options); + } + + if (!string.IsNullOrEmpty(ProtectedWordsPathValue)) + { + writer.WritePropertyName("protected_words_path"); + writer.WriteStringValue(ProtectedWordsPathValue); + } + + if (SplitOnCaseChangeValue.HasValue) + { + writer.WritePropertyName("split_on_case_change"); + writer.WriteBooleanValue(SplitOnCaseChangeValue.Value); + } + + if (SplitOnNumericsValue.HasValue) + { + writer.WritePropertyName("split_on_numerics"); + writer.WriteBooleanValue(SplitOnNumericsValue.Value); + } + + if (StemEnglishPossessiveValue.HasValue) + { + writer.WritePropertyName("stem_english_possessive"); + writer.WriteBooleanValue(StemEnglishPossessiveValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("word_delimiter_graph"); + if (TypeTableValue is not null) + { + writer.WritePropertyName("type_table"); + JsonSerializer.Serialize(writer, TypeTableValue, options); + } + + if (!string.IsNullOrEmpty(TypeTablePathValue)) + { + writer.WritePropertyName("type_table_path"); + writer.WriteStringValue(TypeTablePathValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + WordDelimiterGraphTokenFilter IBuildableDescriptor.Build() => new() + { + AdjustOffsets = AdjustOffsetsValue, + CatenateAll = CatenateAllValue, + CatenateNumbers = CatenateNumbersValue, + CatenateWords = CatenateWordsValue, + GenerateNumberParts = GenerateNumberPartsValue, + GenerateWordParts = GenerateWordPartsValue, + IgnoreKeywords = IgnoreKeywordsValue, + PreserveOriginal = PreserveOriginalValue, + ProtectedWords = ProtectedWordsValue, + ProtectedWordsPath = ProtectedWordsPathValue, + SplitOnCaseChange = SplitOnCaseChangeValue, + SplitOnNumerics = SplitOnNumericsValue, + StemEnglishPossessive = StemEnglishPossessiveValue, + TypeTable = TypeTableValue, + TypeTablePath = TypeTablePathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs new file mode 100644 index 00000000000..598aa62e8fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs @@ -0,0 +1,283 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +public sealed partial class WordDelimiterTokenFilter : ITokenFilter +{ + [JsonInclude, JsonPropertyName("catenate_all")] + public bool? CatenateAll { get; set; } + [JsonInclude, JsonPropertyName("catenate_numbers")] + public bool? CatenateNumbers { get; set; } + [JsonInclude, JsonPropertyName("catenate_words")] + public bool? CatenateWords { get; set; } + [JsonInclude, JsonPropertyName("generate_number_parts")] + public bool? GenerateNumberParts { get; set; } + [JsonInclude, JsonPropertyName("generate_word_parts")] + public bool? GenerateWordParts { get; set; } + [JsonInclude, JsonPropertyName("preserve_original")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? PreserveOriginal { get; set; } + [JsonInclude, JsonPropertyName("protected_words")] + public ICollection? ProtectedWords { get; set; } + [JsonInclude, JsonPropertyName("protected_words_path")] + public string? ProtectedWordsPath { get; set; } + [JsonInclude, JsonPropertyName("split_on_case_change")] + public bool? SplitOnCaseChange { get; set; } + [JsonInclude, JsonPropertyName("split_on_numerics")] + public bool? SplitOnNumerics { get; set; } + [JsonInclude, JsonPropertyName("stem_english_possessive")] + public bool? StemEnglishPossessive { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "word_delimiter"; + + [JsonInclude, JsonPropertyName("type_table")] + public ICollection? TypeTable { get; set; } + [JsonInclude, JsonPropertyName("type_table_path")] + public string? TypeTablePath { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +public sealed partial class WordDelimiterTokenFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal WordDelimiterTokenFilterDescriptor(Action configure) => configure.Invoke(this); + + public WordDelimiterTokenFilterDescriptor() : base() + { + } + + private bool? CatenateAllValue { get; set; } + private bool? CatenateNumbersValue { get; set; } + private bool? CatenateWordsValue { get; set; } + private bool? GenerateNumberPartsValue { get; set; } + private bool? GenerateWordPartsValue { get; set; } + private bool? PreserveOriginalValue { get; set; } + private ICollection? ProtectedWordsValue { get; set; } + private string? ProtectedWordsPathValue { get; set; } + private bool? SplitOnCaseChangeValue { get; set; } + private bool? SplitOnNumericsValue { get; set; } + private bool? StemEnglishPossessiveValue { get; set; } + private ICollection? TypeTableValue { get; set; } + private string? TypeTablePathValue { get; set; } + private string? VersionValue { get; set; } + + public WordDelimiterTokenFilterDescriptor CatenateAll(bool? catenateAll = true) + { + CatenateAllValue = catenateAll; + return Self; + } + + public WordDelimiterTokenFilterDescriptor CatenateNumbers(bool? catenateNumbers = true) + { + CatenateNumbersValue = catenateNumbers; + return Self; + } + + public WordDelimiterTokenFilterDescriptor CatenateWords(bool? catenateWords = true) + { + CatenateWordsValue = catenateWords; + return Self; + } + + public WordDelimiterTokenFilterDescriptor GenerateNumberParts(bool? generateNumberParts = true) + { + GenerateNumberPartsValue = generateNumberParts; + return Self; + } + + public WordDelimiterTokenFilterDescriptor GenerateWordParts(bool? generateWordParts = true) + { + GenerateWordPartsValue = generateWordParts; + return Self; + } + + public WordDelimiterTokenFilterDescriptor PreserveOriginal(bool? preserveOriginal = true) + { + PreserveOriginalValue = preserveOriginal; + return Self; + } + + public WordDelimiterTokenFilterDescriptor ProtectedWords(ICollection? protectedWords) + { + ProtectedWordsValue = protectedWords; + return Self; + } + + public WordDelimiterTokenFilterDescriptor ProtectedWordsPath(string? protectedWordsPath) + { + ProtectedWordsPathValue = protectedWordsPath; + return Self; + } + + public WordDelimiterTokenFilterDescriptor SplitOnCaseChange(bool? splitOnCaseChange = true) + { + SplitOnCaseChangeValue = splitOnCaseChange; + return Self; + } + + public WordDelimiterTokenFilterDescriptor SplitOnNumerics(bool? splitOnNumerics = true) + { + SplitOnNumericsValue = splitOnNumerics; + return Self; + } + + public WordDelimiterTokenFilterDescriptor StemEnglishPossessive(bool? stemEnglishPossessive = true) + { + StemEnglishPossessiveValue = stemEnglishPossessive; + return Self; + } + + public WordDelimiterTokenFilterDescriptor TypeTable(ICollection? typeTable) + { + TypeTableValue = typeTable; + return Self; + } + + public WordDelimiterTokenFilterDescriptor TypeTablePath(string? typeTablePath) + { + TypeTablePathValue = typeTablePath; + return Self; + } + + public WordDelimiterTokenFilterDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CatenateAllValue.HasValue) + { + writer.WritePropertyName("catenate_all"); + writer.WriteBooleanValue(CatenateAllValue.Value); + } + + if (CatenateNumbersValue.HasValue) + { + writer.WritePropertyName("catenate_numbers"); + writer.WriteBooleanValue(CatenateNumbersValue.Value); + } + + if (CatenateWordsValue.HasValue) + { + writer.WritePropertyName("catenate_words"); + writer.WriteBooleanValue(CatenateWordsValue.Value); + } + + if (GenerateNumberPartsValue.HasValue) + { + writer.WritePropertyName("generate_number_parts"); + writer.WriteBooleanValue(GenerateNumberPartsValue.Value); + } + + if (GenerateWordPartsValue.HasValue) + { + writer.WritePropertyName("generate_word_parts"); + writer.WriteBooleanValue(GenerateWordPartsValue.Value); + } + + if (PreserveOriginalValue is not null) + { + writer.WritePropertyName("preserve_original"); + JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + } + + if (ProtectedWordsValue is not null) + { + writer.WritePropertyName("protected_words"); + JsonSerializer.Serialize(writer, ProtectedWordsValue, options); + } + + if (!string.IsNullOrEmpty(ProtectedWordsPathValue)) + { + writer.WritePropertyName("protected_words_path"); + writer.WriteStringValue(ProtectedWordsPathValue); + } + + if (SplitOnCaseChangeValue.HasValue) + { + writer.WritePropertyName("split_on_case_change"); + writer.WriteBooleanValue(SplitOnCaseChangeValue.Value); + } + + if (SplitOnNumericsValue.HasValue) + { + writer.WritePropertyName("split_on_numerics"); + writer.WriteBooleanValue(SplitOnNumericsValue.Value); + } + + if (StemEnglishPossessiveValue.HasValue) + { + writer.WritePropertyName("stem_english_possessive"); + writer.WriteBooleanValue(StemEnglishPossessiveValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("word_delimiter"); + if (TypeTableValue is not null) + { + writer.WritePropertyName("type_table"); + JsonSerializer.Serialize(writer, TypeTableValue, options); + } + + if (!string.IsNullOrEmpty(TypeTablePathValue)) + { + writer.WritePropertyName("type_table_path"); + writer.WriteStringValue(TypeTablePathValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } + + WordDelimiterTokenFilter IBuildableDescriptor.Build() => new() + { + CatenateAll = CatenateAllValue, + CatenateNumbers = CatenateNumbersValue, + CatenateWords = CatenateWordsValue, + GenerateNumberParts = GenerateNumberPartsValue, + GenerateWordParts = GenerateWordPartsValue, + PreserveOriginal = PreserveOriginalValue, + ProtectedWords = ProtectedWordsValue, + ProtectedWordsPath = ProtectedWordsPathValue, + SplitOnCaseChange = SplitOnCaseChangeValue, + SplitOnNumerics = SplitOnNumericsValue, + StemEnglishPossessive = StemEnglishPossessiveValue, + TypeTable = TypeTableValue, + TypeTablePath = TypeTablePathValue, + Version = VersionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs new file mode 100644 index 00000000000..8e93f2e939a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; + +public sealed partial class AsyncSearch +{ + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId? ScrollId { get; init; } + + /// + /// Indicates how many shards have run the query.
Note that in order for shard results to be included in the search response, they need to be reduced first.
+ ///
+ [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + + /// + /// Partial aggregations results, coming from the shards that have already completed the execution of the query. + /// + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata HitsMetadata { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + + /// + /// Indicates how many reductions of the results have been performed.
If this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response.
+ ///
+ [JsonInclude, JsonPropertyName("num_reduce_phases")] + public long? NumReducePhases { get; init; } + [JsonInclude, JsonPropertyName("pit_id")] + public string? PitId { get; init; } + [JsonInclude, JsonPropertyName("profile")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } + [JsonInclude, JsonPropertyName("terminated_early")] + public bool? TerminatedEarly { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkIndexByScrollFailure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkIndexByScrollFailure.g.cs new file mode 100644 index 00000000000..28add2be38b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkIndexByScrollFailure.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class BulkIndexByScrollFailure +{ + [JsonInclude, JsonPropertyName("cause")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Cause { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("status")] + public int Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkStats.g.cs new file mode 100644 index 00000000000..3766a6beae2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/BulkStats.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class BulkStats +{ + [JsonInclude, JsonPropertyName("avg_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? AvgSize { get; init; } + [JsonInclude, JsonPropertyName("avg_size_in_bytes")] + public long AvgSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("avg_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? AvgTime { get; init; } + [JsonInclude, JsonPropertyName("avg_time_in_millis")] + public long AvgTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_operations")] + public long TotalOperations { get; init; } + [JsonInclude, JsonPropertyName("total_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalSize { get; init; } + [JsonInclude, JsonPropertyName("total_size_in_bytes")] + public long TotalSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs new file mode 100644 index 00000000000..d03ebd289a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ByteSize : Union +{ + public ByteSize(long byteSize) : base(byteSize) + { + } + + public ByteSize(string byteSize) : base(byteSize) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationDecision.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationDecision.g.cs new file mode 100644 index 00000000000..c1d6a8c5cb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationDecision.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class AllocationDecision +{ + [JsonInclude, JsonPropertyName("decider")] + public string Decider { get; init; } + [JsonInclude, JsonPropertyName("decision")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.AllocationExplainDecision Decision { get; init; } + [JsonInclude, JsonPropertyName("explanation")] + public string Explanation { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationStore.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationStore.g.cs new file mode 100644 index 00000000000..ad6ec5dddd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/AllocationStore.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class AllocationStore +{ + [JsonInclude, JsonPropertyName("allocation_id")] + public string AllocationId { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } + [JsonInclude, JsonPropertyName("in_sync")] + public bool InSync { get; init; } + [JsonInclude, JsonPropertyName("matching_size_in_bytes")] + public long MatchingSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("matching_sync_id")] + public bool MatchingSyncId { get; init; } + [JsonInclude, JsonPropertyName("store_exception")] + public string StoreException { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs new file mode 100644 index 00000000000..3c274c10373 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class CharFilterTypes +{ + /// + /// Contains statistics about analyzer types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("analyzer_types")] + public IReadOnlyCollection AnalyzerTypes { get; init; } + + /// + /// Contains statistics about built-in analyzers used in selected nodes. + /// + [JsonInclude, JsonPropertyName("built_in_analyzers")] + public IReadOnlyCollection BuiltInAnalyzers { get; init; } + + /// + /// Contains statistics about built-in character filters used in selected nodes. + /// + [JsonInclude, JsonPropertyName("built_in_char_filters")] + public IReadOnlyCollection BuiltInCharFilters { get; init; } + + /// + /// Contains statistics about built-in token filters used in selected nodes. + /// + [JsonInclude, JsonPropertyName("built_in_filters")] + public IReadOnlyCollection BuiltInFilters { get; init; } + + /// + /// Contains statistics about built-in tokenizers used in selected nodes. + /// + [JsonInclude, JsonPropertyName("built_in_tokenizers")] + public IReadOnlyCollection BuiltInTokenizers { get; init; } + + /// + /// Contains statistics about token filter types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("filter_types")] + public IReadOnlyCollection FilterTypes { get; init; } + + /// + /// Contains statistics about tokenizer types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("tokenizer_types")] + public IReadOnlyCollection TokenizerTypes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterFileSystem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterFileSystem.g.cs new file mode 100644 index 00000000000..bef525f6364 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterFileSystem.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterFileSystem +{ + /// + /// Total number of bytes available to JVM in file stores across all selected nodes.
Depending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`.
This is the actual amount of free disk space the selected Elasticsearch nodes can use.
+ ///
+ [JsonInclude, JsonPropertyName("available_in_bytes")] + public long AvailableInBytes { get; init; } + + /// + /// Total number of unallocated bytes in file stores across all selected nodes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long FreeInBytes { get; init; } + + /// + /// Total size, in bytes, of all file stores across all selected nodes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndices.g.cs new file mode 100644 index 00000000000..464bca20c23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndices.g.cs @@ -0,0 +1,97 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterIndices +{ + /// + /// Contains statistics about analyzers and analyzer components used in selected nodes. + /// + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.CharFilterTypes Analysis { get; init; } + + /// + /// Contains statistics about memory used for completion in selected nodes. + /// + [JsonInclude, JsonPropertyName("completion")] + public Elastic.Clients.Elasticsearch.Serverless.CompletionStats Completion { get; init; } + + /// + /// Total number of indices with shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// Contains counts for documents in selected nodes. + /// + [JsonInclude, JsonPropertyName("docs")] + public Elastic.Clients.Elasticsearch.Serverless.DocStats Docs { get; init; } + + /// + /// Contains statistics about the field data cache of selected nodes. + /// + [JsonInclude, JsonPropertyName("fielddata")] + public Elastic.Clients.Elasticsearch.Serverless.FielddataStats Fielddata { get; init; } + + /// + /// Contains statistics about field mappings in selected nodes. + /// + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.FieldTypesMappings Mappings { get; init; } + + /// + /// Contains statistics about the query cache of selected nodes. + /// + [JsonInclude, JsonPropertyName("query_cache")] + public Elastic.Clients.Elasticsearch.Serverless.QueryCacheStats QueryCache { get; init; } + + /// + /// Contains statistics about segments in selected nodes. + /// + [JsonInclude, JsonPropertyName("segments")] + public Elastic.Clients.Elasticsearch.Serverless.SegmentsStats Segments { get; init; } + + /// + /// Contains statistics about indices with shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterIndicesShards Shards { get; init; } + + /// + /// Contains statistics about the size of shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("store")] + public Elastic.Clients.Elasticsearch.Serverless.StoreStats Store { get; init; } + + /// + /// Contains statistics about analyzers and analyzer components used in selected nodes. + /// + [JsonInclude, JsonPropertyName("versions")] + public IReadOnlyCollection? Versions { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShards.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShards.g.cs new file mode 100644 index 00000000000..0e475599360 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShards.g.cs @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +/// +/// Contains statistics about shards assigned to selected nodes. +/// +public sealed partial class ClusterIndicesShards +{ + /// + /// Contains statistics about shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterIndicesShardsIndex? Index { get; init; } + + /// + /// Number of primary shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("primaries")] + public double? Primaries { get; init; } + + /// + /// Ratio of replica shards to primary shards across all selected nodes. + /// + [JsonInclude, JsonPropertyName("replication")] + public double? Replication { get; init; } + + /// + /// Total number of shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("total")] + public double? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs new file mode 100644 index 00000000000..6c8acd5616f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterIndicesShardsIndex +{ + /// + /// Contains statistics about the number of primary shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("primaries")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterShardMetrics Primaries { get; init; } + + /// + /// Contains statistics about the number of replication shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("replication")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterShardMetrics Replication { get; init; } + + /// + /// Contains statistics about the number of shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterShardMetrics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterInfo.g.cs new file mode 100644 index 00000000000..8c55dfd3e76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterInfo.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterInfo +{ + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + [JsonInclude, JsonPropertyName("reserved_sizes")] + public IReadOnlyCollection ReservedSizes { get; init; } + [JsonInclude, JsonPropertyName("shard_data_set_sizes")] + public IReadOnlyDictionary? ShardDataSetSizes { get; init; } + [JsonInclude, JsonPropertyName("shard_paths")] + public IReadOnlyDictionary ShardPaths { get; init; } + [JsonInclude, JsonPropertyName("shard_sizes")] + public IReadOnlyDictionary ShardSizes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIngest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIngest.g.cs new file mode 100644 index 00000000000..9a5f7cbff91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterIngest.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterIngest +{ + [JsonInclude, JsonPropertyName("number_of_pipelines")] + public int NumberOfPipelines { get; init; } + [JsonInclude, JsonPropertyName("processor_stats")] + public IReadOnlyDictionary ProcessorStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvm.g.cs new file mode 100644 index 00000000000..320145049d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvm.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterJvm +{ + /// + /// Uptime duration, in milliseconds, since JVM last started. + /// + [JsonInclude, JsonPropertyName("max_uptime_in_millis")] + public long MaxUptimeInMillis { get; init; } + + /// + /// Contains statistics about memory used by selected nodes. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterJvmMemory Mem { get; init; } + + /// + /// Number of active threads in use by JVM across all selected nodes. + /// + [JsonInclude, JsonPropertyName("threads")] + public long Threads { get; init; } + + /// + /// Contains statistics about the JVM versions used by selected nodes. + /// + [JsonInclude, JsonPropertyName("versions")] + public IReadOnlyCollection Versions { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmMemory.g.cs new file mode 100644 index 00000000000..e76690e787b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmMemory.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterJvmMemory +{ + /// + /// Maximum amount of memory, in bytes, available for use by the heap across all selected nodes. + /// + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public long HeapMaxInBytes { get; init; } + + /// + /// Memory, in bytes, currently in use by the heap across all selected nodes. + /// + [JsonInclude, JsonPropertyName("heap_used_in_bytes")] + public long HeapUsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmVersion.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmVersion.g.cs new file mode 100644 index 00000000000..d8a39fe1f22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterJvmVersion.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterJvmVersion +{ + /// + /// Always `true`. All distributions come with a bundled Java Development Kit (JDK). + /// + [JsonInclude, JsonPropertyName("bundled_jdk")] + public bool BundledJdk { get; init; } + + /// + /// Total number of selected nodes using JVM. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// If `true`, a bundled JDK is in use by JVM. + /// + [JsonInclude, JsonPropertyName("using_bundled_jdk")] + public bool UsingBundledJdk { get; init; } + + /// + /// Version of JVM used by one or more selected nodes. + /// + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } + + /// + /// Name of the JVM. + /// + [JsonInclude, JsonPropertyName("vm_name")] + public string VmName { get; init; } + + /// + /// Vendor of the JVM. + /// + [JsonInclude, JsonPropertyName("vm_vendor")] + public string VmVendor { get; init; } + + /// + /// Full version number of JVM.
The full version number includes a plus sign (+) followed by the build number.
+ ///
+ [JsonInclude, JsonPropertyName("vm_version")] + public string VmVersion { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs new file mode 100644 index 00000000000..17f5e823d4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterNetworkTypes +{ + /// + /// Contains statistics about the HTTP network types used by selected nodes. + /// + [JsonInclude, JsonPropertyName("http_types")] + public IReadOnlyDictionary HttpTypes { get; init; } + + /// + /// Contains statistics about the transport network types used by selected nodes. + /// + [JsonInclude, JsonPropertyName("transport_types")] + public IReadOnlyDictionary TransportTypes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodeCount.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodeCount.g.cs new file mode 100644 index 00000000000..6d4180f2f52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodeCount.g.cs @@ -0,0 +1,60 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterNodeCount +{ + [JsonInclude, JsonPropertyName("coordinating_only")] + public int CoordinatingOnly { get; init; } + [JsonInclude, JsonPropertyName("data")] + public int Data { get; init; } + [JsonInclude, JsonPropertyName("data_cold")] + public int DataCold { get; init; } + [JsonInclude, JsonPropertyName("data_content")] + public int DataContent { get; init; } + [JsonInclude, JsonPropertyName("data_frozen")] + public int? DataFrozen { get; init; } + [JsonInclude, JsonPropertyName("data_hot")] + public int DataHot { get; init; } + [JsonInclude, JsonPropertyName("data_warm")] + public int DataWarm { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public int Ingest { get; init; } + [JsonInclude, JsonPropertyName("master")] + public int Master { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public int Ml { get; init; } + [JsonInclude, JsonPropertyName("remote_cluster_client")] + public int RemoteClusterClient { get; init; } + [JsonInclude, JsonPropertyName("total")] + public int Total { get; init; } + [JsonInclude, JsonPropertyName("transform")] + public int Transform { get; init; } + [JsonInclude, JsonPropertyName("voting_only")] + public int VotingOnly { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodes.g.cs new file mode 100644 index 00000000000..3f193c15b82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterNodes.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterNodes +{ + /// + /// Contains counts for nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("count")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterNodeCount Count { get; init; } + + /// + /// Contains statistics about the discovery types used by selected nodes. + /// + [JsonInclude, JsonPropertyName("discovery_types")] + public IReadOnlyDictionary DiscoveryTypes { get; init; } + + /// + /// Contains statistics about file stores by selected nodes. + /// + [JsonInclude, JsonPropertyName("fs")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterFileSystem Fs { get; init; } + [JsonInclude, JsonPropertyName("indexing_pressure")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexingPressure IndexingPressure { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterIngest Ingest { get; init; } + + /// + /// Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes. + /// + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterJvm Jvm { get; init; } + + /// + /// Contains statistics about the transport and HTTP networks used by selected nodes. + /// + [JsonInclude, JsonPropertyName("network_types")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterNetworkTypes NetworkTypes { get; init; } + + /// + /// Contains statistics about the operating systems used by selected nodes. + /// + [JsonInclude, JsonPropertyName("os")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterOperatingSystem Os { get; init; } + + /// + /// Contains statistics about Elasticsearch distributions installed on selected nodes. + /// + [JsonInclude, JsonPropertyName("packaging_types")] + public IReadOnlyCollection PackagingTypes { get; init; } + + /// + /// Contains statistics about installed plugins and modules by selected nodes.
If no plugins or modules are installed, this array is empty.
+ ///
+ [JsonInclude, JsonPropertyName("plugins")] + public IReadOnlyCollection Plugins { get; init; } + + /// + /// Contains statistics about processes used by selected nodes. + /// + [JsonInclude, JsonPropertyName("process")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterProcess Process { get; init; } + + /// + /// Array of Elasticsearch versions used on selected nodes. + /// + [JsonInclude, JsonPropertyName("versions")] + public IReadOnlyCollection Versions { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs new file mode 100644 index 00000000000..c610b1055a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterOperatingSystem +{ + /// + /// Number of processors used to calculate thread pool size across all selected nodes.
This number can be set with the processors setting of a node and defaults to the number of processors reported by the operating system.
In both cases, this number will never be larger than 32.
+ ///
+ [JsonInclude, JsonPropertyName("allocated_processors")] + public int AllocatedProcessors { get; init; } + + /// + /// Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes. + /// + [JsonInclude, JsonPropertyName("architectures")] + public IReadOnlyCollection? Architectures { get; init; } + + /// + /// Number of processors available to JVM across all selected nodes. + /// + [JsonInclude, JsonPropertyName("available_processors")] + public int AvailableProcessors { get; init; } + + /// + /// Contains statistics about memory used by selected nodes. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.OperatingSystemMemoryInfo Mem { get; init; } + + /// + /// Contains statistics about operating systems used by selected nodes. + /// + [JsonInclude, JsonPropertyName("names")] + public IReadOnlyCollection Names { get; init; } + + /// + /// Contains statistics about operating systems used by selected nodes. + /// + [JsonInclude, JsonPropertyName("pretty_names")] + public IReadOnlyCollection PrettyNames { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs new file mode 100644 index 00000000000..d7d3d6ccf0d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterOperatingSystemArchitecture +{ + /// + /// Name of an architecture used by one or more selected nodes. + /// + [JsonInclude, JsonPropertyName("arch")] + public string Arch { get; init; } + + /// + /// Number of selected nodes using the architecture. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs new file mode 100644 index 00000000000..f75d4e2505d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterOperatingSystemName +{ + /// + /// Number of selected nodes using the operating system. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Name of an operating system used by one or more selected nodes. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs new file mode 100644 index 00000000000..b86279d176c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterOperatingSystemPrettyName +{ + /// + /// Number of selected nodes using the operating system. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Human-readable name of an operating system used by one or more selected nodes. + /// + [JsonInclude, JsonPropertyName("pretty_name")] + public string PrettyName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcess.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcess.g.cs new file mode 100644 index 00000000000..bef11994b67 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcess.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterProcess +{ + /// + /// Contains statistics about CPU used by selected nodes. + /// + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterProcessCpu Cpu { get; init; } + + /// + /// Contains statistics about open file descriptors in selected nodes. + /// + [JsonInclude, JsonPropertyName("open_file_descriptors")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterProcessOpenFileDescriptors OpenFileDescriptors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessCpu.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessCpu.g.cs new file mode 100644 index 00000000000..0ecd38a47ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessCpu.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterProcessCpu +{ + /// + /// Percentage of CPU used across all selected nodes.
Returns `-1` if not supported.
+ ///
+ [JsonInclude, JsonPropertyName("percent")] + public int Percent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs new file mode 100644 index 00000000000..2c4cc40ccff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterProcessOpenFileDescriptors +{ + /// + /// Average number of concurrently open file descriptors.
Returns `-1` if not supported.
+ ///
+ [JsonInclude, JsonPropertyName("avg")] + public long Avg { get; init; } + + /// + /// Maximum number of concurrently open file descriptors allowed across all selected nodes.
Returns `-1` if not supported.
+ ///
+ [JsonInclude, JsonPropertyName("max")] + public long Max { get; init; } + + /// + /// Minimum number of concurrently open file descriptors across all selected nodes.
Returns -1 if not supported.
+ ///
+ [JsonInclude, JsonPropertyName("min")] + public long Min { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessor.g.cs new file mode 100644 index 00000000000..fb7bcd0cb17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterProcessor.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterProcessor +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("current")] + public long Current { get; init; } + [JsonInclude, JsonPropertyName("failed")] + public long Failed { get; init; } + [JsonInclude, JsonPropertyName("time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Time { get; init; } + [JsonInclude, JsonPropertyName("time_in_millis")] + public long TimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterShardMetrics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterShardMetrics.g.cs new file mode 100644 index 00000000000..6b3c9b26533 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ClusterShardMetrics.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterShardMetrics +{ + /// + /// Mean number of shards in an index, counting only shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("avg")] + public double Avg { get; init; } + + /// + /// Maximum number of shards in an index, counting only shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("max")] + public double Max { get; init; } + + /// + /// Minimum number of shards in an index, counting only shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("min")] + public double Min { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CurrentNode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CurrentNode.g.cs new file mode 100644 index 00000000000..e96acb32e06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CurrentNode.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class CurrentNode +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } + [JsonInclude, JsonPropertyName("weight_ranking")] + public int WeightRanking { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/DiskUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/DiskUsage.g.cs new file mode 100644 index 00000000000..f930354f4a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/DiskUsage.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class DiskUsage +{ + [JsonInclude, JsonPropertyName("free_bytes")] + public long FreeBytes { get; init; } + [JsonInclude, JsonPropertyName("free_disk_percent")] + public double FreeDiskPercent { get; init; } + [JsonInclude, JsonPropertyName("path")] + public string Path { get; init; } + [JsonInclude, JsonPropertyName("total_bytes")] + public long TotalBytes { get; init; } + [JsonInclude, JsonPropertyName("used_bytes")] + public long UsedBytes { get; init; } + [JsonInclude, JsonPropertyName("used_disk_percent")] + public double UsedDiskPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypes.g.cs new file mode 100644 index 00000000000..b2f48f7fd75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypes.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class FieldTypes +{ + /// + /// The number of occurrences of the field type in selected nodes. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// The number of indices containing the field type in selected nodes. + /// + [JsonInclude, JsonPropertyName("index_count")] + public int IndexCount { get; init; } + + /// + /// For dense_vector field types, number of indexed vector types in selected nodes. + /// + [JsonInclude, JsonPropertyName("indexed_vector_count")] + public long? IndexedVectorCount { get; init; } + + /// + /// For dense_vector field types, the maximum dimension of all indexed vector types in selected nodes. + /// + [JsonInclude, JsonPropertyName("indexed_vector_dim_max")] + public long? IndexedVectorDimMax { get; init; } + + /// + /// For dense_vector field types, the minimum dimension of all indexed vector types in selected nodes. + /// + [JsonInclude, JsonPropertyName("indexed_vector_dim_min")] + public long? IndexedVectorDimMin { get; init; } + + /// + /// The name for the field type in selected nodes. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// The number of fields that declare a script. + /// + [JsonInclude, JsonPropertyName("script_count")] + public int? ScriptCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypesMappings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypesMappings.g.cs new file mode 100644 index 00000000000..4782bb02b8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/FieldTypesMappings.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class FieldTypesMappings +{ + /// + /// Contains statistics about field data types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("field_types")] + public IReadOnlyCollection FieldTypes { get; init; } + + /// + /// Contains statistics about runtime field data types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("runtime_field_types")] + public IReadOnlyCollection? RuntimeFieldTypes { get; init; } + + /// + /// Total number of fields in all non-system indices, accounting for mapping deduplication. + /// + [JsonInclude, JsonPropertyName("total_deduplicated_field_count")] + public int? TotalDeduplicatedFieldCount { get; init; } + + /// + /// Total size of all mappings after deduplication and compression. + /// + [JsonInclude, JsonPropertyName("total_deduplicated_mapping_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalDeduplicatedMappingSize { get; init; } + + /// + /// Total size of all mappings, in bytes, after deduplication and compression. + /// + [JsonInclude, JsonPropertyName("total_deduplicated_mapping_size_in_bytes")] + public long? TotalDeduplicatedMappingSizeInBytes { get; init; } + + /// + /// Total number of fields in all non-system indices. + /// + [JsonInclude, JsonPropertyName("total_field_count")] + public int? TotalFieldCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexHealthStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexHealthStats.g.cs new file mode 100644 index 00000000000..e9f1e22a8a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexHealthStats.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class IndexHealthStats +{ + [JsonInclude, JsonPropertyName("active_primary_shards")] + public int ActivePrimaryShards { get; init; } + [JsonInclude, JsonPropertyName("active_shards")] + public int ActiveShards { get; init; } + [JsonInclude, JsonPropertyName("initializing_shards")] + public int InitializingShards { get; init; } + [JsonInclude, JsonPropertyName("number_of_replicas")] + public int NumberOfReplicas { get; init; } + [JsonInclude, JsonPropertyName("number_of_shards")] + public int NumberOfShards { get; init; } + [JsonInclude, JsonPropertyName("relocating_shards")] + public int RelocatingShards { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary? Shards { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("unassigned_shards")] + public int UnassignedShards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressure.g.cs new file mode 100644 index 00000000000..04570263351 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressure.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class IndexingPressure +{ + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexingPressureMemory Memory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemory.g.cs new file mode 100644 index 00000000000..522db76567f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemory.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class IndexingPressureMemory +{ + [JsonInclude, JsonPropertyName("current")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexingPressureMemorySummary Current { get; init; } + [JsonInclude, JsonPropertyName("limit_in_bytes")] + public long LimitInBytes { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexingPressureMemorySummary Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemorySummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemorySummary.g.cs new file mode 100644 index 00000000000..edb0e5c0743 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndexingPressureMemorySummary.g.cs @@ -0,0 +1,48 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class IndexingPressureMemorySummary +{ + [JsonInclude, JsonPropertyName("all_in_bytes")] + public long AllInBytes { get; init; } + [JsonInclude, JsonPropertyName("combined_coordinating_and_primary_in_bytes")] + public long CombinedCoordinatingAndPrimaryInBytes { get; init; } + [JsonInclude, JsonPropertyName("coordinating_in_bytes")] + public long CoordinatingInBytes { get; init; } + [JsonInclude, JsonPropertyName("coordinating_rejections")] + public long? CoordinatingRejections { get; init; } + [JsonInclude, JsonPropertyName("primary_in_bytes")] + public long PrimaryInBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_rejections")] + public long? PrimaryRejections { get; init; } + [JsonInclude, JsonPropertyName("replica_in_bytes")] + public long ReplicaInBytes { get; init; } + [JsonInclude, JsonPropertyName("replica_rejections")] + public long? ReplicaRejections { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndicesVersions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndicesVersions.g.cs new file mode 100644 index 00000000000..76b70da60a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/IndicesVersions.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class IndicesVersions +{ + [JsonInclude, JsonPropertyName("index_count")] + public int IndexCount { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_count")] + public int PrimaryShardCount { get; init; } + [JsonInclude, JsonPropertyName("total_primary_bytes")] + public long TotalPrimaryBytes { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs new file mode 100644 index 00000000000..a7d5a34d3cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs @@ -0,0 +1,48 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class NodeAllocationExplanation +{ + [JsonInclude, JsonPropertyName("deciders")] + public IReadOnlyCollection Deciders { get; init; } + [JsonInclude, JsonPropertyName("node_attributes")] + public IReadOnlyDictionary NodeAttributes { get; init; } + [JsonInclude, JsonPropertyName("node_decision")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision NodeDecision { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } + [JsonInclude, JsonPropertyName("node_name")] + public string NodeName { get; init; } + [JsonInclude, JsonPropertyName("store")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.AllocationStore? Store { get; init; } + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } + [JsonInclude, JsonPropertyName("weight_ranking")] + public int WeightRanking { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeDiskUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeDiskUsage.g.cs new file mode 100644 index 00000000000..b7f97e64762 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodeDiskUsage.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class NodeDiskUsage +{ + [JsonInclude, JsonPropertyName("least_available")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.DiskUsage LeastAvailable { get; init; } + [JsonInclude, JsonPropertyName("most_available")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.DiskUsage MostAvailable { get; init; } + [JsonInclude, JsonPropertyName("node_name")] + public string NodeName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodePackagingType.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodePackagingType.g.cs new file mode 100644 index 00000000000..5ea45302090 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/NodePackagingType.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class NodePackagingType +{ + /// + /// Number of selected nodes using the distribution flavor and file type. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Type of Elasticsearch distribution. This is always `default`. + /// + [JsonInclude, JsonPropertyName("flavor")] + public string Flavor { get; init; } + + /// + /// File type (such as `tar` or `zip`) used for the distribution package. + /// + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs new file mode 100644 index 00000000000..bf9be164a4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class OperatingSystemMemoryInfo +{ + /// + /// Total amount, in bytes, of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set. + /// + [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public long? AdjustedTotalInBytes { get; init; } + + /// + /// Amount, in bytes, of free physical memory across all selected nodes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long FreeInBytes { get; init; } + + /// + /// Percentage of free physical memory across all selected nodes. + /// + [JsonInclude, JsonPropertyName("free_percent")] + public int FreePercent { get; init; } + + /// + /// Total amount, in bytes, of physical memory across all selected nodes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long TotalInBytes { get; init; } + + /// + /// Amount, in bytes, of physical memory in use across all selected nodes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long UsedInBytes { get; init; } + + /// + /// Percentage of physical memory in use across all selected nodes. + /// + [JsonInclude, JsonPropertyName("used_percent")] + public int UsedPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/PendingTask.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/PendingTask.g.cs new file mode 100644 index 00000000000..7730460d81b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/PendingTask.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class PendingTask +{ + /// + /// Indicates whether the pending tasks are currently executing or not. + /// + [JsonInclude, JsonPropertyName("executing")] + public bool Executing { get; init; } + + /// + /// The number that represents when the task has been inserted into the task queue. + /// + [JsonInclude, JsonPropertyName("insert_order")] + public int InsertOrder { get; init; } + + /// + /// The priority of the pending task.
The valid priorities in descending priority order are: `IMMEDIATE` > `URGENT` > `HIGH` > `NORMAL` > `LOW` > `LANGUID`.
+ ///
+ [JsonInclude, JsonPropertyName("priority")] + public string Priority { get; init; } + + /// + /// A general description of the cluster task that may include a reason and origin. + /// + [JsonInclude, JsonPropertyName("source")] + public string Source { get; init; } + + /// + /// The time since the task is waiting for being performed. + /// + [JsonInclude, JsonPropertyName("time_in_queue")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TimeInQueue { get; init; } + + /// + /// The time expressed in milliseconds since the task is waiting for being performed. + /// + [JsonInclude, JsonPropertyName("time_in_queue_millis")] + public long TimeInQueueMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ReservedSize.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ReservedSize.g.cs new file mode 100644 index 00000000000..8b173c6134f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ReservedSize.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ReservedSize +{ + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } + [JsonInclude, JsonPropertyName("path")] + public string Path { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyCollection Shards { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs new file mode 100644 index 00000000000..24dd42aeae5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs @@ -0,0 +1,115 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class RuntimeFieldTypes +{ + /// + /// Maximum number of characters for a single runtime field script. + /// + [JsonInclude, JsonPropertyName("chars_max")] + public int CharsMax { get; init; } + + /// + /// Total number of characters for the scripts that define the current runtime field data type. + /// + [JsonInclude, JsonPropertyName("chars_total")] + public int CharsTotal { get; init; } + + /// + /// Number of runtime fields mapped to the field data type in selected nodes. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Maximum number of accesses to doc_values for a single runtime field script + /// + [JsonInclude, JsonPropertyName("doc_max")] + public int DocMax { get; init; } + + /// + /// Total number of accesses to doc_values for the scripts that define the current runtime field data type. + /// + [JsonInclude, JsonPropertyName("doc_total")] + public int DocTotal { get; init; } + + /// + /// Number of indices containing a mapping of the runtime field data type in selected nodes. + /// + [JsonInclude, JsonPropertyName("index_count")] + public int IndexCount { get; init; } + + /// + /// Script languages used for the runtime fields scripts. + /// + [JsonInclude, JsonPropertyName("lang")] + public IReadOnlyCollection Lang { get; init; } + + /// + /// Maximum number of lines for a single runtime field script. + /// + [JsonInclude, JsonPropertyName("lines_max")] + public int LinesMax { get; init; } + + /// + /// Total number of lines for the scripts that define the current runtime field data type. + /// + [JsonInclude, JsonPropertyName("lines_total")] + public int LinesTotal { get; init; } + + /// + /// Field data type used in selected nodes. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// Number of runtime fields that don’t declare a script. + /// + [JsonInclude, JsonPropertyName("scriptless_count")] + public int ScriptlessCount { get; init; } + + /// + /// Number of runtime fields that shadow an indexed field. + /// + [JsonInclude, JsonPropertyName("shadowed_count")] + public int ShadowedCount { get; init; } + + /// + /// Maximum number of accesses to _source for a single runtime field script. + /// + [JsonInclude, JsonPropertyName("source_max")] + public int SourceMax { get; init; } + + /// + /// Total number of accesses to _source for the scripts that define the current runtime field data type. + /// + [JsonInclude, JsonPropertyName("source_total")] + public int SourceTotal { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ShardHealthStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ShardHealthStats.g.cs new file mode 100644 index 00000000000..36433d2d2fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ShardHealthStats.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ShardHealthStats +{ + [JsonInclude, JsonPropertyName("active_shards")] + public int ActiveShards { get; init; } + [JsonInclude, JsonPropertyName("initializing_shards")] + public int InitializingShards { get; init; } + [JsonInclude, JsonPropertyName("primary_active")] + public bool PrimaryActive { get; init; } + [JsonInclude, JsonPropertyName("relocating_shards")] + public int RelocatingShards { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("unassigned_shards")] + public int UnassignedShards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/UnassignedInformation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/UnassignedInformation.g.cs new file mode 100644 index 00000000000..cbd08538bb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/UnassignedInformation.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class UnassignedInformation +{ + [JsonInclude, JsonPropertyName("allocation_status")] + public string? AllocationStatus { get; init; } + [JsonInclude, JsonPropertyName("at")] + public DateTimeOffset At { get; init; } + [JsonInclude, JsonPropertyName("delayed")] + public bool? Delayed { get; init; } + [JsonInclude, JsonPropertyName("details")] + public string? Details { get; init; } + [JsonInclude, JsonPropertyName("failed_allocation_attempts")] + public int? FailedAllocationAttempts { get; init; } + [JsonInclude, JsonPropertyName("last_allocation_status")] + public string? LastAllocationStatus { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.UnassignedInformationReason Reason { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs new file mode 100644 index 00000000000..8d515996627 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ClusterDetails +{ + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public string Indices { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterSearchStatus Status { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long? Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterStatistics.g.cs new file mode 100644 index 00000000000..dab06b8add2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterStatistics.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ClusterStatistics +{ + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyDictionary? Details { get; init; } + [JsonInclude, JsonPropertyName("skipped")] + public int Skipped { get; init; } + [JsonInclude, JsonPropertyName("successful")] + public int Successful { get; init; } + [JsonInclude, JsonPropertyName("total")] + public int Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CompletionStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CompletionStats.g.cs new file mode 100644 index 00000000000..07f10390f6d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CompletionStats.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class CompletionStats +{ + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.FieldSizeUsage))] + public IReadOnlyDictionary? Fields { get; init; } + + /// + /// Total amount of memory used for completion across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Size { get; init; } + + /// + /// Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("size_in_bytes")] + public long SizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CoordsGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CoordsGeoBounds.g.cs new file mode 100644 index 00000000000..957212869db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/CoordsGeoBounds.g.cs @@ -0,0 +1,92 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class CoordsGeoBounds +{ + [JsonInclude, JsonPropertyName("bottom")] + public double Bottom { get; set; } + [JsonInclude, JsonPropertyName("left")] + public double Left { get; set; } + [JsonInclude, JsonPropertyName("right")] + public double Right { get; set; } + [JsonInclude, JsonPropertyName("top")] + public double Top { get; set; } +} + +public sealed partial class CoordsGeoBoundsDescriptor : SerializableDescriptor +{ + internal CoordsGeoBoundsDescriptor(Action configure) => configure.Invoke(this); + + public CoordsGeoBoundsDescriptor() : base() + { + } + + private double BottomValue { get; set; } + private double LeftValue { get; set; } + private double RightValue { get; set; } + private double TopValue { get; set; } + + public CoordsGeoBoundsDescriptor Bottom(double bottom) + { + BottomValue = bottom; + return Self; + } + + public CoordsGeoBoundsDescriptor Left(double left) + { + LeftValue = left; + return Self; + } + + public CoordsGeoBoundsDescriptor Right(double right) + { + RightValue = right; + return Self; + } + + public CoordsGeoBoundsDescriptor Top(double top) + { + TopValue = top; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bottom"); + writer.WriteNumberValue(BottomValue); + writer.WritePropertyName("left"); + writer.WriteNumberValue(LeftValue); + writer.WritePropertyName("right"); + writer.WriteNumberValue(RightValue); + writer.WritePropertyName("top"); + writer.WriteNumberValue(TopValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Bulk/ResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Bulk/ResponseItem.g.cs new file mode 100644 index 00000000000..3fb4ee404b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Bulk/ResponseItem.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; + +public abstract partial class ResponseItem +{ + [JsonInclude, JsonPropertyName("_id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long? PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("get")] + public Elastic.Clients.Elasticsearch.Serverless.InlineGet? Get { get; init; } + [JsonInclude, JsonPropertyName("result")] + public string? Result { get; init; } + [JsonInclude, JsonPropertyName("status")] + public int Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs new file mode 100644 index 00000000000..0dc1f09bc91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Context : Union +{ + public Context(string category) : base(category) + { + } + + public Context(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) : base(location) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/Explanation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/Explanation.g.cs new file mode 100644 index 00000000000..3f69857c215 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/Explanation.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Explain; + +public sealed partial class Explanation +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyCollection Details { get; init; } + [JsonInclude, JsonPropertyName("value")] + public float Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/ExplanationDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/ExplanationDetail.g.cs new file mode 100644 index 00000000000..0b9f1dd656d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Explain/ExplanationDetail.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Explain; + +public sealed partial class ExplanationDetail +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyCollection? Details { get; init; } + [JsonInclude, JsonPropertyName("value")] + public float Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs new file mode 100644 index 00000000000..1931ffb8988 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.FieldCaps; + +public sealed partial class FieldCapability +{ + /// + /// Whether this field can be aggregated on all indices. + /// + [JsonInclude, JsonPropertyName("aggregatable")] + public bool Aggregatable { get; init; } + + /// + /// The list of indices where this field has the same type family, or null if all indices have the same type family for the field. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; init; } + + /// + /// Merged metadata across all indices as a map of string keys to arrays of values. A value length of 1 indicates that all indices had the same value for this key, while a length of 2 or more indicates that not all indices had the same value for this key. + /// + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// Whether this field is registered as a metadata field. + /// + [JsonInclude, JsonPropertyName("metadata_field")] + public bool? MetadataField { get; init; } + + /// + /// The list of indices where this field is present if these indices
don’t have the same `time_series_metric` value for this field.
+ ///
+ [JsonInclude, JsonPropertyName("metric_conflicts_indices")] + public IReadOnlyCollection? MetricConflictsIndices { get; init; } + + /// + /// The list of indices where this field is not aggregatable, or null if all indices have the same definition for the field. + /// + [JsonInclude, JsonPropertyName("non_aggregatable_indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? NonAggregatableIndices { get; init; } + + /// + /// If this list is present in response then some indices have the
field marked as a dimension and other indices, the ones in this list, do not.
+ ///
+ [JsonInclude, JsonPropertyName("non_dimension_indices")] + public IReadOnlyCollection? NonDimensionIndices { get; init; } + + /// + /// The list of indices where this field is not searchable, or null if all indices have the same definition for the field. + /// + [JsonInclude, JsonPropertyName("non_searchable_indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? NonSearchableIndices { get; init; } + + /// + /// Whether this field is indexed for search on all indices. + /// + [JsonInclude, JsonPropertyName("searchable")] + public bool Searchable { get; init; } + + /// + /// Whether this field is used as a time series dimension. + /// + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; init; } + + /// + /// Contains metric type if this fields is used as a time series
metrics, absent if the field is not used as metric.
+ ///
+ [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Get/GetResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Get/GetResult.g.cs new file mode 100644 index 00000000000..27a0026c782 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Get/GetResult.g.cs @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Get; + +public sealed partial class GetResult +{ + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long? PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_source")] + [SourceConverter] + public TDocument? Source { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValues? Fields { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetError.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetError.g.cs new file mode 100644 index 00000000000..33b2f3f6ce9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetError.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MGet; + +public sealed partial class MultiGetError +{ + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Error { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetOperation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetOperation.g.cs new file mode 100644 index 00000000000..1a057df9e20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MGet/MultiGetOperation.g.cs @@ -0,0 +1,183 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MGet; + +public sealed partial class MultiGetOperation +{ + /// + /// The unique document ID. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// The index that contains the document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// If `false`, excludes all _source fields. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + + /// + /// The key for the primary shard the document resides on. Required if routing is used during indexing. + /// + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// The stored fields you want to retrieve. + /// + [JsonInclude, JsonPropertyName("stored_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + [JsonInclude, JsonPropertyName("version_type")] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get; set; } +} + +public sealed partial class MultiGetOperationDescriptor : SerializableDescriptor +{ + internal MultiGetOperationDescriptor(Action configure) => configure.Invoke(this); + + public MultiGetOperationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + /// + /// The unique document ID. + /// + public MultiGetOperationDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The index that contains the document. + /// + public MultiGetOperationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// If `false`, excludes all _source fields. + /// + public MultiGetOperationDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// The key for the primary shard the document resides on. Required if routing is used during indexing. + /// + public MultiGetOperationDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// The stored fields you want to retrieve. + /// + public MultiGetOperationDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public MultiGetOperationDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MultiGetOperationDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs new file mode 100644 index 00000000000..3c941cd5300 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; + +public sealed partial class MultiSearchItem +{ + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.Serverless.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata HitsMetadata { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + [JsonInclude, JsonPropertyName("num_reduce_phases")] + public long? NumReducePhases { get; init; } + [JsonInclude, JsonPropertyName("pit_id")] + public string? PitId { get; init; } + [JsonInclude, JsonPropertyName("profile")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("status")] + public int? Status { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } + [JsonInclude, JsonPropertyName("terminated_early")] + public bool? TerminatedEarly { get; init; } + [JsonInclude, JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchBody.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchBody.g.cs new file mode 100644 index 00000000000..e514e7fb6e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchBody.g.cs @@ -0,0 +1,2505 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; + +internal sealed partial class MultisearchBodyConverter : JsonConverter +{ + public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new MultisearchBody(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_source") + { + variant.Source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "aggregations" || property == "aggs") + { + variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "collapse") + { + variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "docvalue_fields") + { + variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "explain") + { + variant.Explain = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ext") + { + variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "fields") + { + variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "highlight") + { + variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_boost") + { + variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + continue; + } + + if (property == "knn") + { + variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "min_score") + { + variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pit") + { + variant.Pit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "post_filter") + { + variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "profile") + { + variant.Profile = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rescore") + { + variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "search_after") + { + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "seq_no_primary_term") + { + variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "size") + { + variant.Size = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "sort") + { + variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stats") + { + variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stored_fields") + { + variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "suggest") + { + variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "terminate_after") + { + variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "timeout") + { + variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_scores") + { + variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_total_hits") + { + variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, MultisearchBody value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Source is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, value.Source, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.Collapse is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, value.Collapse, options); + } + + if (value.DocvalueFields is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, value.DocvalueFields, options); + } + + if (value.Explain.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(value.Explain.Value); + } + + if (value.Ext is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, value.Ext, options); + } + + if (value.Fields is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, value.Fields, options); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.IndicesBoost is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, value.IndicesBoost, options); + } + + if (value.Knn is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, value.Knn, options); + } + + if (value.MinScore.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(value.MinScore.Value); + } + + if (value.Pit is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, value.Pit, options); + } + + if (value.PostFilter is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, value.PostFilter, options); + } + + if (value.Profile.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(value.Profile.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.Rescore is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, value.Rescore, options); + } + + if (value.RuntimeMappings is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, value.RuntimeMappings, options); + } + + if (value.ScriptFields is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, value.ScriptFields, options); + } + + if (value.SearchAfter is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, value.SearchAfter, options); + } + + if (value.SeqNoPrimaryTerm.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + } + + if (value.Stats is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, value.Stats, options); + } + + if (value.StoredFields is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, value.StoredFields, options); + } + + if (value.Suggest is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, value.Suggest, options); + } + + if (value.TerminateAfter.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(value.TerminateAfter.Value); + } + + if (!string.IsNullOrEmpty(value.Timeout)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(value.Timeout); + } + + if (value.TrackScores.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(value.TrackScores.Value); + } + + if (value.TrackTotalHits is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, value.TrackTotalHits, options); + } + + if (value.Version.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(value.Version.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MultisearchBodyConverter))] +public sealed partial class MultisearchBody +{ + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ public ICollection? DocvalueFields { get; set; } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public bool? Explain { get; set; } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public IDictionary? Ext { get; set; } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public ICollection? Fields { get; set; } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ public int? From { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; } + + /// + /// Boosts the _score of documents from specified indices. + /// + public ICollection>? IndicesBoost { get; set; } + + /// + /// Defines the approximate kNN search to run. + /// + public ICollection? Knn { get; set; } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ public double? MinScore { get; set; } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; set; } + public bool? Profile { get; set; } + + /// + /// Defines the search definition using the Query DSL. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + public ICollection? Rescore { get; set; } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ public IDictionary? RuntimeMappings { get; set; } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public IDictionary? ScriptFields { get; set; } + public ICollection? SearchAfter { get; set; } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ public bool? SeqNoPrimaryTerm { get; set; } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ public int? Size { get; set; } + public ICollection? Sort { get; set; } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ public ICollection? Stats { get; set; } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ public long? TerminateAfter { get; set; } + + /// + /// 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.
+ ///
+ public string? Timeout { get; set; } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public bool? TrackScores { get; set; } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; set; } + + /// + /// If true, returns document version as part of a hit. + /// + public bool? Version { get; set; } +} + +public sealed partial class MultisearchBodyDescriptor : SerializableDescriptor> +{ + internal MultisearchBodyDescriptor(Action> configure) => configure.Invoke(this); + + public MultisearchBodyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Action> configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ public MultisearchBodyDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public MultisearchBodyDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public MultisearchBodyDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Action> configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public MultisearchBodyDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public MultisearchBodyDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Knn(Action> configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Knn(params Action>[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(Action> configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public MultisearchBodyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public MultisearchBodyDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public MultisearchBodyDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Rescore(Action> configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Rescore(params Action>[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public MultisearchBodyDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ public MultisearchBodyDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public MultisearchBodyDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public MultisearchBodyDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ public MultisearchBodyDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ public MultisearchBodyDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ public MultisearchBodyDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public MultisearchBodyDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ public MultisearchBodyDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public MultisearchBodyDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MultisearchBodyDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ public MultisearchBodyDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ public MultisearchBodyDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ public MultisearchBodyDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ public MultisearchBodyDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ public MultisearchBodyDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public MultisearchBodyDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public MultisearchBodyDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ public MultisearchBodyDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public MultisearchBodyDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MultisearchBodyDescriptor : SerializableDescriptor +{ + internal MultisearchBodyDescriptor(Action configure) => configure.Invoke(this); + + public MultisearchBodyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } + private ICollection? FieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private ICollection? KnnValue { get; set; } + private KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } + private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private ICollection? RescoreValue { get; set; } + private Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private IDictionary? ExtValue { get; set; } + private int? FromValue { get; set; } + private ICollection>? IndicesBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; } + private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } + private bool? ProfileValue { get; set; } + private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private ICollection? SearchAfterValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? StatsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? SuggestValue { get; set; } + private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } + private Action SuggestDescriptorAction { get; set; } + private long? TerminateAfterValue { get; set; } + private string? TimeoutValue { get; set; } + private bool? TrackScoresValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? VersionValue { get; set; } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Collapse(Action configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ public MultisearchBodyDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public MultisearchBodyDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public MultisearchBodyDescriptor Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Defines the approximate kNN search to run. + /// + public MultisearchBodyDescriptor Knn(ICollection? knn) + { + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnValue = knn; + return Self; + } + + public MultisearchBodyDescriptor Knn(KnnQueryDescriptor descriptor) + { + KnnValue = null; + KnnDescriptorAction = null; + KnnDescriptorActions = null; + KnnDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Knn(Action configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorActions = null; + KnnDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Knn(params Action[] configure) + { + KnnValue = null; + KnnDescriptor = null; + KnnDescriptorAction = null; + KnnDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter) + { + PostFilterDescriptor = null; + PostFilterDescriptorAction = null; + PostFilterValue = postFilter; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + { + PostFilterValue = null; + PostFilterDescriptorAction = null; + PostFilterDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor PostFilter(Action configure) + { + PostFilterValue = null; + PostFilterDescriptor = null; + PostFilterDescriptorAction = configure; + return Self; + } + + /// + /// Defines the search definition using the Query DSL. + /// + public MultisearchBodyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public MultisearchBodyDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Rescore(ICollection? rescore) + { + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreValue = rescore; + return Self; + } + + public MultisearchBodyDescriptor Rescore(Core.Search.RescoreDescriptor descriptor) + { + RescoreValue = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = null; + RescoreDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Rescore(Action configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorActions = null; + RescoreDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Rescore(params Action[] configure) + { + RescoreValue = null; + RescoreDescriptor = null; + RescoreDescriptorAction = null; + RescoreDescriptorActions = configure; + return Self; + } + + public MultisearchBodyDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public MultisearchBodyDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + /// + /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ public MultisearchBodyDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// If true, returns detailed information about score computation as part of a hit. + /// + public MultisearchBodyDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Configuration of search extensions defined by Elasticsearch plugins. + /// + public MultisearchBodyDescriptor Ext(Func, FluentDictionary> selector) + { + ExtValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ public MultisearchBodyDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + /// + /// Boosts the _score of documents from specified indices. + /// + public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) + { + IndicesBoostValue = indicesBoost; + return Self; + } + + /// + /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ public MultisearchBodyDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ public MultisearchBodyDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit) + { + PitDescriptor = null; + PitDescriptorAction = null; + PitValue = pit; + return Self; + } + + public MultisearchBodyDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + { + PitValue = null; + PitDescriptorAction = null; + PitDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Pit(Action configure) + { + PitValue = null; + PitDescriptor = null; + PitDescriptorAction = configure; + return Self; + } + + public MultisearchBodyDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ public MultisearchBodyDescriptor RuntimeMappings(Func, FluentDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Retrieve a script evaluation (based on different fields) for each hit. + /// + public MultisearchBodyDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MultisearchBodyDescriptor SearchAfter(ICollection? searchAfter) + { + SearchAfterValue = searchAfter; + return Self; + } + + /// + /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ public MultisearchBodyDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ public MultisearchBodyDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ public MultisearchBodyDescriptor Stats(ICollection? stats) + { + StatsValue = stats; + return Self; + } + + /// + /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ public MultisearchBodyDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest) + { + SuggestDescriptor = null; + SuggestDescriptorAction = null; + SuggestValue = suggest; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + { + SuggestValue = null; + SuggestDescriptorAction = null; + SuggestDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Suggest(Action configure) + { + SuggestValue = null; + SuggestDescriptor = null; + SuggestDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ public MultisearchBodyDescriptor TerminateAfter(long? terminateAfter) + { + TerminateAfterValue = terminateAfter; + return Self; + } + + /// + /// 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.
+ ///
+ public MultisearchBodyDescriptor Timeout(string? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// If true, calculate and return document scores, even if the scores are not used for sorting. + /// + public MultisearchBodyDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + /// + /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ public MultisearchBodyDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If true, returns document version as part of a hit. + /// + public MultisearchBodyDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (KnnDescriptor is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, KnnDescriptor, options); + } + else if (KnnDescriptorAction is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + } + else if (KnnDescriptorActions is not null) + { + writer.WritePropertyName("knn"); + if (KnnDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in KnnDescriptorActions) + { + JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + } + + if (KnnDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (KnnValue is not null) + { + writer.WritePropertyName("knn"); + SingleOrManySerializationHelper.Serialize(KnnValue, writer, options); + } + + if (PostFilterDescriptor is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterDescriptor, options); + } + else if (PostFilterDescriptorAction is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + } + else if (PostFilterValue is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, PostFilterValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RescoreDescriptor is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, RescoreDescriptor, options); + } + else if (RescoreDescriptorAction is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + } + else if (RescoreDescriptorActions is not null) + { + writer.WritePropertyName("rescore"); + if (RescoreDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in RescoreDescriptorActions) + { + JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + } + + if (RescoreDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (RescoreValue is not null) + { + writer.WritePropertyName("rescore"); + SingleOrManySerializationHelper.Serialize(RescoreValue, writer, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (ExtValue is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, ExtValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IndicesBoostValue is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, IndicesBoostValue, options); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (PitDescriptor is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitDescriptor, options); + } + else if (PitDescriptorAction is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + } + else if (PitValue is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, PitValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SearchAfterValue is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, SearchAfterValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StatsValue is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, StatsValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (SuggestDescriptor is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestDescriptor, options); + } + else if (SuggestDescriptorAction is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + } + else if (SuggestValue is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, SuggestValue, options); + } + + if (TerminateAfterValue.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(TerminateAfterValue.Value); + } + + if (!string.IsNullOrEmpty(TimeoutValue)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(TimeoutValue); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs new file mode 100644 index 00000000000..01366f5b7d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs @@ -0,0 +1,220 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; + +/// +/// Contains parameters used to limit or change the subsequent search body request. +/// +public sealed partial class MultisearchHeader +{ + [JsonInclude, JsonPropertyName("allow_no_indices")] + public bool? AllowNoIndices { get; set; } + [JsonInclude, JsonPropertyName("allow_partial_search_results")] + public bool? AllowPartialSearchResults { get; set; } + [JsonInclude, JsonPropertyName("ccs_minimize_roundtrips")] + public bool? CcsMinimizeRoundtrips { get; set; } + [JsonInclude, JsonPropertyName("expand_wildcards")] + [JsonConverter(typeof(ExpandWildcardsConverter))] + public ICollection? ExpandWildcards { get; set; } + [JsonInclude, JsonPropertyName("ignore_throttled")] + public bool? IgnoreThrottled { get; set; } + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Index { get; set; } + [JsonInclude, JsonPropertyName("preference")] + public string? Preference { get; set; } + [JsonInclude, JsonPropertyName("request_cache")] + public bool? RequestCache { get; set; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + [JsonInclude, JsonPropertyName("search_type")] + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get; set; } +} + +/// +/// Contains parameters used to limit or change the subsequent search body request. +/// +public sealed partial class MultisearchHeaderDescriptor : SerializableDescriptor +{ + internal MultisearchHeaderDescriptor(Action configure) => configure.Invoke(this); + + public MultisearchHeaderDescriptor() : base() + { + } + + private bool? AllowNoIndicesValue { get; set; } + private bool? AllowPartialSearchResultsValue { get; set; } + private bool? CcsMinimizeRoundtripsValue { get; set; } + private ICollection? ExpandWildcardsValue { get; set; } + private bool? IgnoreThrottledValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexValue { get; set; } + private string? PreferenceValue { get; set; } + private bool? RequestCacheValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchTypeValue { get; set; } + + public MultisearchHeaderDescriptor AllowNoIndices(bool? allowNoIndices = true) + { + AllowNoIndicesValue = allowNoIndices; + return Self; + } + + public MultisearchHeaderDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) + { + AllowPartialSearchResultsValue = allowPartialSearchResults; + return Self; + } + + public MultisearchHeaderDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) + { + CcsMinimizeRoundtripsValue = ccsMinimizeRoundtrips; + return Self; + } + + public MultisearchHeaderDescriptor ExpandWildcards(ICollection? expandWildcards) + { + ExpandWildcardsValue = expandWildcards; + return Self; + } + + public MultisearchHeaderDescriptor IgnoreThrottled(bool? ignoreThrottled = true) + { + IgnoreThrottledValue = ignoreThrottled; + return Self; + } + + public MultisearchHeaderDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + public MultisearchHeaderDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.Indices? index) + { + IndexValue = index; + return Self; + } + + public MultisearchHeaderDescriptor Preference(string? preference) + { + PreferenceValue = preference; + return Self; + } + + public MultisearchHeaderDescriptor RequestCache(bool? requestCache = true) + { + RequestCacheValue = requestCache; + return Self; + } + + public MultisearchHeaderDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + public MultisearchHeaderDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) + { + SearchTypeValue = searchType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoIndicesValue.HasValue) + { + writer.WritePropertyName("allow_no_indices"); + writer.WriteBooleanValue(AllowNoIndicesValue.Value); + } + + if (AllowPartialSearchResultsValue.HasValue) + { + writer.WritePropertyName("allow_partial_search_results"); + writer.WriteBooleanValue(AllowPartialSearchResultsValue.Value); + } + + if (CcsMinimizeRoundtripsValue.HasValue) + { + writer.WritePropertyName("ccs_minimize_roundtrips"); + writer.WriteBooleanValue(CcsMinimizeRoundtripsValue.Value); + } + + if (ExpandWildcardsValue is not null) + { + writer.WritePropertyName("expand_wildcards"); + SingleOrManySerializationHelper.Serialize(ExpandWildcardsValue, writer, options); + } + + if (IgnoreThrottledValue.HasValue) + { + writer.WritePropertyName("ignore_throttled"); + writer.WriteBooleanValue(IgnoreThrottledValue.Value); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (!string.IsNullOrEmpty(PreferenceValue)) + { + writer.WritePropertyName("preference"); + writer.WriteStringValue(PreferenceValue); + } + + if (RequestCacheValue.HasValue) + { + writer.WritePropertyName("request_cache"); + writer.WriteBooleanValue(RequestCacheValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchTypeValue is not null) + { + writer.WritePropertyName("search_type"); + JsonSerializer.Serialize(writer, SearchTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs new file mode 100644 index 00000000000..9ac5856c7e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate; + +public sealed partial class TemplateConfig +{ + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// ID of the search template to use. If no source is specified,
this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("profile")] + public bool? Profile { get; set; } + + /// + /// An inline search template. Supports the same parameters as the search API's
request body. Also supports Mustache variables. If no id is specified, this
parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } +} + +public sealed partial class TemplateConfigDescriptor : SerializableDescriptor +{ + internal TemplateConfigDescriptor(Action configure) => configure.Invoke(this); + + public TemplateConfigDescriptor() : base() + { + } + + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private bool? ProfileValue { get; set; } + private string? SourceValue { get; set; } + + public TemplateConfigDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// ID of the search template to use. If no source is specified,
this parameter is required.
+ ///
+ public TemplateConfigDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + public TemplateConfigDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TemplateConfigDescriptor Profile(bool? profile = true) + { + ProfileValue = profile; + return Self; + } + + /// + /// An inline search template. Supports the same parameters as the search API's
request body. Also supports Mustache variables. If no id is specified, this
parameter is required.
+ ///
+ public TemplateConfigDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (ProfileValue.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(ProfileValue.Value); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs new file mode 100644 index 00000000000..484e35a782e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs @@ -0,0 +1,480 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors; + +public sealed partial class MultiTermVectorsOperation +{ + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + [JsonInclude, JsonPropertyName("doc")] + public object? Doc { get; set; } + [JsonInclude, JsonPropertyName("field_statistics")] + public bool? FieldStatistics { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? Filter { get; set; } + [JsonInclude, JsonPropertyName("offsets")] + public bool? Offsets { get; set; } + [JsonInclude, JsonPropertyName("payloads")] + public bool? Payloads { get; set; } + [JsonInclude, JsonPropertyName("positions")] + public bool? Positions { get; set; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + [JsonInclude, JsonPropertyName("term_statistics")] + public bool? TermStatistics { get; set; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + [JsonInclude, JsonPropertyName("version_type")] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get; set; } +} + +public sealed partial class MultiTermVectorsOperationDescriptor : SerializableDescriptor> +{ + internal MultiTermVectorsOperationDescriptor(Action> configure) => configure.Invoke(this); + + public MultiTermVectorsOperationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private object? DocValue { get; set; } + private bool? FieldStatisticsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? FilterValue { get; set; } + private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private bool? OffsetsValue { get; set; } + private bool? PayloadsValue { get; set; } + private bool? PositionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private bool? TermStatisticsValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + public MultiTermVectorsOperationDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public MultiTermVectorsOperationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + public MultiTermVectorsOperationDescriptor Doc(object? doc) + { + DocValue = doc; + return Self; + } + + public MultiTermVectorsOperationDescriptor FieldStatistics(bool? fieldStatistics = true) + { + FieldStatisticsValue = fieldStatistics; + return Self; + } + + public MultiTermVectorsOperationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public MultiTermVectorsOperationDescriptor Offsets(bool? offsets = true) + { + OffsetsValue = offsets; + return Self; + } + + public MultiTermVectorsOperationDescriptor Payloads(bool? payloads = true) + { + PayloadsValue = payloads; + return Self; + } + + public MultiTermVectorsOperationDescriptor Positions(bool? positions = true) + { + PositionsValue = positions; + return Self; + } + + public MultiTermVectorsOperationDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + public MultiTermVectorsOperationDescriptor TermStatistics(bool? termStatistics = true) + { + TermStatisticsValue = termStatistics; + return Self; + } + + public MultiTermVectorsOperationDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MultiTermVectorsOperationDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + JsonSerializer.Serialize(writer, DocValue, options); + } + + if (FieldStatisticsValue.HasValue) + { + writer.WritePropertyName("field_statistics"); + writer.WriteBooleanValue(FieldStatisticsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (OffsetsValue.HasValue) + { + writer.WritePropertyName("offsets"); + writer.WriteBooleanValue(OffsetsValue.Value); + } + + if (PayloadsValue.HasValue) + { + writer.WritePropertyName("payloads"); + writer.WriteBooleanValue(PayloadsValue.Value); + } + + if (PositionsValue.HasValue) + { + writer.WritePropertyName("positions"); + writer.WriteBooleanValue(PositionsValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (TermStatisticsValue.HasValue) + { + writer.WritePropertyName("term_statistics"); + writer.WriteBooleanValue(TermStatisticsValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MultiTermVectorsOperationDescriptor : SerializableDescriptor +{ + internal MultiTermVectorsOperationDescriptor(Action configure) => configure.Invoke(this); + + public MultiTermVectorsOperationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private object? DocValue { get; set; } + private bool? FieldStatisticsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? FilterValue { get; set; } + private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private bool? OffsetsValue { get; set; } + private bool? PayloadsValue { get; set; } + private bool? PositionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private bool? TermStatisticsValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + public MultiTermVectorsOperationDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public MultiTermVectorsOperationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + public MultiTermVectorsOperationDescriptor Doc(object? doc) + { + DocValue = doc; + return Self; + } + + public MultiTermVectorsOperationDescriptor FieldStatistics(bool? fieldStatistics = true) + { + FieldStatisticsValue = fieldStatistics; + return Self; + } + + public MultiTermVectorsOperationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public MultiTermVectorsOperationDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public MultiTermVectorsOperationDescriptor Offsets(bool? offsets = true) + { + OffsetsValue = offsets; + return Self; + } + + public MultiTermVectorsOperationDescriptor Payloads(bool? payloads = true) + { + PayloadsValue = payloads; + return Self; + } + + public MultiTermVectorsOperationDescriptor Positions(bool? positions = true) + { + PositionsValue = positions; + return Self; + } + + public MultiTermVectorsOperationDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + public MultiTermVectorsOperationDescriptor TermStatistics(bool? termStatistics = true) + { + TermStatisticsValue = termStatistics; + return Self; + } + + public MultiTermVectorsOperationDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MultiTermVectorsOperationDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + JsonSerializer.Serialize(writer, DocValue, options); + } + + if (FieldStatisticsValue.HasValue) + { + writer.WritePropertyName("field_statistics"); + writer.WriteBooleanValue(FieldStatisticsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (OffsetsValue.HasValue) + { + writer.WritePropertyName("offsets"); + writer.WriteBooleanValue(OffsetsValue.Value); + } + + if (PayloadsValue.HasValue) + { + writer.WritePropertyName("payloads"); + writer.WriteBooleanValue(PayloadsValue.Value); + } + + if (PositionsValue.HasValue) + { + writer.WritePropertyName("positions"); + writer.WriteBooleanValue(PositionsValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (TermStatisticsValue.HasValue) + { + writer.WritePropertyName("term_statistics"); + writer.WriteBooleanValue(TermStatisticsValue.Value); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs new file mode 100644 index 00000000000..e98ebb6dfb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors; + +public sealed partial class MultiTermVectorsResult +{ + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool? Found { get; init; } + [JsonInclude, JsonPropertyName("term_vectors")] + [ReadOnlyFieldDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.TermVector))] + public IReadOnlyDictionary? TermVectors { get; init; } + [JsonInclude, JsonPropertyName("took")] + public long? Took { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs new file mode 100644 index 00000000000..76fb1e8d07d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MGet; + +public sealed partial class MultiGetResponseItem : Union, Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetError> +{ + public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Serverless.Core.Get.GetResult result) : base(result) + { + } + + public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetError failure) : base(failure) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs new file mode 100644 index 00000000000..4dd7d222374 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; + +public sealed partial class MultiSearchResponseItem : Union, Elastic.Clients.Elasticsearch.Serverless.ErrorResponseBase> +{ + public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Serverless.Core.MSearch.MultiSearchItem result) : base(result) + { + } + + public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Serverless.ErrorResponseBase failure) : base(failure) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/DocumentRating.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/DocumentRating.g.cs new file mode 100644 index 00000000000..071c9f0d4fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/DocumentRating.g.cs @@ -0,0 +1,101 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class DocumentRating +{ + /// + /// The document ID. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// The document’s index. For data streams, this should be the document’s backing index. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } + + /// + /// The document’s relevance with regard to this search request. + /// + [JsonInclude, JsonPropertyName("rating")] + public int Rating { get; set; } +} + +public sealed partial class DocumentRatingDescriptor : SerializableDescriptor +{ + internal DocumentRatingDescriptor(Action configure) => configure.Invoke(this); + + public DocumentRatingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private int RatingValue { get; set; } + + /// + /// The document ID. + /// + public DocumentRatingDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The document’s index. For data streams, this should be the document’s backing index. + /// + public DocumentRatingDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// The document’s relevance with regard to this search request. + /// + public DocumentRatingDescriptor Rating(int rating) + { + RatingValue = rating; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WritePropertyName("rating"); + writer.WriteNumberValue(RatingValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHit.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHit.g.cs new file mode 100644 index 00000000000..ae87096d60b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHit.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalHit +{ + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_score")] + public double Score { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs new file mode 100644 index 00000000000..2df8dccb8a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalHitItem +{ + [JsonInclude, JsonPropertyName("hit")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalHit Hit { get; init; } + [JsonInclude, JsonPropertyName("rating")] + public double? Rating { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs new file mode 100644 index 00000000000..b934afee6f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs @@ -0,0 +1,273 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalMetric +{ + [JsonInclude, JsonPropertyName("dcg")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? Dcg { get; set; } + [JsonInclude, JsonPropertyName("expected_reciprocal_rank")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricExpectedReciprocalRank? ExpectedReciprocalRank { get; set; } + [JsonInclude, JsonPropertyName("mean_reciprocal_rank")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricMeanReciprocalRank? MeanReciprocalRank { get; set; } + [JsonInclude, JsonPropertyName("precision")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricPrecision? Precision { get; set; } + [JsonInclude, JsonPropertyName("recall")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecall? Recall { get; set; } +} + +public sealed partial class RankEvalMetricDescriptor : SerializableDescriptor +{ + internal RankEvalMetricDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? DcgValue { get; set; } + private RankEvalMetricDiscountedCumulativeGainDescriptor DcgDescriptor { get; set; } + private Action DcgDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricExpectedReciprocalRank? ExpectedReciprocalRankValue { get; set; } + private RankEvalMetricExpectedReciprocalRankDescriptor ExpectedReciprocalRankDescriptor { get; set; } + private Action ExpectedReciprocalRankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricMeanReciprocalRank? MeanReciprocalRankValue { get; set; } + private RankEvalMetricMeanReciprocalRankDescriptor MeanReciprocalRankDescriptor { get; set; } + private Action MeanReciprocalRankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricPrecision? PrecisionValue { get; set; } + private RankEvalMetricPrecisionDescriptor PrecisionDescriptor { get; set; } + private Action PrecisionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecall? RecallValue { get; set; } + private RankEvalMetricRecallDescriptor RecallDescriptor { get; set; } + private Action RecallDescriptorAction { get; set; } + + public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? dcg) + { + DcgDescriptor = null; + DcgDescriptorAction = null; + DcgValue = dcg; + return Self; + } + + public RankEvalMetricDescriptor Dcg(RankEvalMetricDiscountedCumulativeGainDescriptor descriptor) + { + DcgValue = null; + DcgDescriptorAction = null; + DcgDescriptor = descriptor; + return Self; + } + + public RankEvalMetricDescriptor Dcg(Action configure) + { + DcgValue = null; + DcgDescriptor = null; + DcgDescriptorAction = configure; + return Self; + } + + public RankEvalMetricDescriptor ExpectedReciprocalRank(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricExpectedReciprocalRank? expectedReciprocalRank) + { + ExpectedReciprocalRankDescriptor = null; + ExpectedReciprocalRankDescriptorAction = null; + ExpectedReciprocalRankValue = expectedReciprocalRank; + return Self; + } + + public RankEvalMetricDescriptor ExpectedReciprocalRank(RankEvalMetricExpectedReciprocalRankDescriptor descriptor) + { + ExpectedReciprocalRankValue = null; + ExpectedReciprocalRankDescriptorAction = null; + ExpectedReciprocalRankDescriptor = descriptor; + return Self; + } + + public RankEvalMetricDescriptor ExpectedReciprocalRank(Action configure) + { + ExpectedReciprocalRankValue = null; + ExpectedReciprocalRankDescriptor = null; + ExpectedReciprocalRankDescriptorAction = configure; + return Self; + } + + public RankEvalMetricDescriptor MeanReciprocalRank(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricMeanReciprocalRank? meanReciprocalRank) + { + MeanReciprocalRankDescriptor = null; + MeanReciprocalRankDescriptorAction = null; + MeanReciprocalRankValue = meanReciprocalRank; + return Self; + } + + public RankEvalMetricDescriptor MeanReciprocalRank(RankEvalMetricMeanReciprocalRankDescriptor descriptor) + { + MeanReciprocalRankValue = null; + MeanReciprocalRankDescriptorAction = null; + MeanReciprocalRankDescriptor = descriptor; + return Self; + } + + public RankEvalMetricDescriptor MeanReciprocalRank(Action configure) + { + MeanReciprocalRankValue = null; + MeanReciprocalRankDescriptor = null; + MeanReciprocalRankDescriptorAction = configure; + return Self; + } + + public RankEvalMetricDescriptor Precision(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricPrecision? precision) + { + PrecisionDescriptor = null; + PrecisionDescriptorAction = null; + PrecisionValue = precision; + return Self; + } + + public RankEvalMetricDescriptor Precision(RankEvalMetricPrecisionDescriptor descriptor) + { + PrecisionValue = null; + PrecisionDescriptorAction = null; + PrecisionDescriptor = descriptor; + return Self; + } + + public RankEvalMetricDescriptor Precision(Action configure) + { + PrecisionValue = null; + PrecisionDescriptor = null; + PrecisionDescriptorAction = configure; + return Self; + } + + public RankEvalMetricDescriptor Recall(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecall? recall) + { + RecallDescriptor = null; + RecallDescriptorAction = null; + RecallValue = recall; + return Self; + } + + public RankEvalMetricDescriptor Recall(RankEvalMetricRecallDescriptor descriptor) + { + RecallValue = null; + RecallDescriptorAction = null; + RecallDescriptor = descriptor; + return Self; + } + + public RankEvalMetricDescriptor Recall(Action configure) + { + RecallValue = null; + RecallDescriptor = null; + RecallDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DcgDescriptor is not null) + { + writer.WritePropertyName("dcg"); + JsonSerializer.Serialize(writer, DcgDescriptor, options); + } + else if (DcgDescriptorAction is not null) + { + writer.WritePropertyName("dcg"); + JsonSerializer.Serialize(writer, new RankEvalMetricDiscountedCumulativeGainDescriptor(DcgDescriptorAction), options); + } + else if (DcgValue is not null) + { + writer.WritePropertyName("dcg"); + JsonSerializer.Serialize(writer, DcgValue, options); + } + + if (ExpectedReciprocalRankDescriptor is not null) + { + writer.WritePropertyName("expected_reciprocal_rank"); + JsonSerializer.Serialize(writer, ExpectedReciprocalRankDescriptor, options); + } + else if (ExpectedReciprocalRankDescriptorAction is not null) + { + writer.WritePropertyName("expected_reciprocal_rank"); + JsonSerializer.Serialize(writer, new RankEvalMetricExpectedReciprocalRankDescriptor(ExpectedReciprocalRankDescriptorAction), options); + } + else if (ExpectedReciprocalRankValue is not null) + { + writer.WritePropertyName("expected_reciprocal_rank"); + JsonSerializer.Serialize(writer, ExpectedReciprocalRankValue, options); + } + + if (MeanReciprocalRankDescriptor is not null) + { + writer.WritePropertyName("mean_reciprocal_rank"); + JsonSerializer.Serialize(writer, MeanReciprocalRankDescriptor, options); + } + else if (MeanReciprocalRankDescriptorAction is not null) + { + writer.WritePropertyName("mean_reciprocal_rank"); + JsonSerializer.Serialize(writer, new RankEvalMetricMeanReciprocalRankDescriptor(MeanReciprocalRankDescriptorAction), options); + } + else if (MeanReciprocalRankValue is not null) + { + writer.WritePropertyName("mean_reciprocal_rank"); + JsonSerializer.Serialize(writer, MeanReciprocalRankValue, options); + } + + if (PrecisionDescriptor is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionDescriptor, options); + } + else if (PrecisionDescriptorAction is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, new RankEvalMetricPrecisionDescriptor(PrecisionDescriptorAction), options); + } + else if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (RecallDescriptor is not null) + { + writer.WritePropertyName("recall"); + JsonSerializer.Serialize(writer, RecallDescriptor, options); + } + else if (RecallDescriptorAction is not null) + { + writer.WritePropertyName("recall"); + JsonSerializer.Serialize(writer, new RankEvalMetricRecallDescriptor(RecallDescriptorAction), options); + } + else if (RecallValue is not null) + { + writer.WritePropertyName("recall"); + JsonSerializer.Serialize(writer, RecallValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs new file mode 100644 index 00000000000..16d62ac3f0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalMetricDetail +{ + /// + /// The hits section shows a grouping of the search results with their supplied ratings + /// + [JsonInclude, JsonPropertyName("hits")] + public IReadOnlyCollection Hits { get; init; } + + /// + /// The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results + /// + [JsonInclude, JsonPropertyName("metric_details")] + public IReadOnlyDictionary> MetricDetails { get; init; } + + /// + /// The metric_score in the details section shows the contribution of this query to the global quality metric score + /// + [JsonInclude, JsonPropertyName("metric_score")] + public double MetricScore { get; init; } + + /// + /// The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn’t have a ratings value. This can be used to ask the user to supply ratings for these documents + /// + [JsonInclude, JsonPropertyName("unrated_docs")] + public IReadOnlyCollection UnratedDocs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs new file mode 100644 index 00000000000..19417c80dd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +/// +/// Discounted cumulative gain (DCG) +/// +public sealed partial class RankEvalMetricDiscountedCumulativeGain +{ + [JsonInclude, JsonPropertyName("k")] + public int? k { get; set; } + + /// + /// If set to true, this metric will calculate the Normalized DCG. + /// + [JsonInclude, JsonPropertyName("normalize")] + public bool? Normalize { get; set; } +} + +/// +/// Discounted cumulative gain (DCG) +/// +public sealed partial class RankEvalMetricDiscountedCumulativeGainDescriptor : SerializableDescriptor +{ + internal RankEvalMetricDiscountedCumulativeGainDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricDiscountedCumulativeGainDescriptor() : base() + { + } + + private int? kValue { get; set; } + private bool? NormalizeValue { get; set; } + + public RankEvalMetricDiscountedCumulativeGainDescriptor k(int? k) + { + kValue = k; + return Self; + } + + /// + /// If set to true, this metric will calculate the Normalized DCG. + /// + public RankEvalMetricDiscountedCumulativeGainDescriptor Normalize(bool? normalize = true) + { + NormalizeValue = normalize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (kValue.HasValue) + { + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue.Value); + } + + if (NormalizeValue.HasValue) + { + writer.WritePropertyName("normalize"); + writer.WriteBooleanValue(NormalizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs new file mode 100644 index 00000000000..ecfe0fa728d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +/// +/// Expected Reciprocal Rank (ERR) +/// +public sealed partial class RankEvalMetricExpectedReciprocalRank +{ + [JsonInclude, JsonPropertyName("k")] + public int? k { get; set; } + + /// + /// The highest relevance grade used in the user-supplied relevance judgments. + /// + [JsonInclude, JsonPropertyName("maximum_relevance")] + public int MaximumRelevance { get; set; } +} + +/// +/// Expected Reciprocal Rank (ERR) +/// +public sealed partial class RankEvalMetricExpectedReciprocalRankDescriptor : SerializableDescriptor +{ + internal RankEvalMetricExpectedReciprocalRankDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricExpectedReciprocalRankDescriptor() : base() + { + } + + private int? kValue { get; set; } + private int MaximumRelevanceValue { get; set; } + + public RankEvalMetricExpectedReciprocalRankDescriptor k(int? k) + { + kValue = k; + return Self; + } + + /// + /// The highest relevance grade used in the user-supplied relevance judgments. + /// + public RankEvalMetricExpectedReciprocalRankDescriptor MaximumRelevance(int maximumRelevance) + { + MaximumRelevanceValue = maximumRelevance; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (kValue.HasValue) + { + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue.Value); + } + + writer.WritePropertyName("maximum_relevance"); + writer.WriteNumberValue(MaximumRelevanceValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs new file mode 100644 index 00000000000..f6074297ee2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs @@ -0,0 +1,84 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +/// +/// Mean Reciprocal Rank +/// +public sealed partial class RankEvalMetricMeanReciprocalRank +{ + [JsonInclude, JsonPropertyName("k")] + public int? k { get; set; } + [JsonInclude, JsonPropertyName("relevant_rating_threshold")] + public int? RelevantRatingThreshold { get; set; } +} + +/// +/// Mean Reciprocal Rank +/// +public sealed partial class RankEvalMetricMeanReciprocalRankDescriptor : SerializableDescriptor +{ + internal RankEvalMetricMeanReciprocalRankDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricMeanReciprocalRankDescriptor() : base() + { + } + + private int? kValue { get; set; } + private int? RelevantRatingThresholdValue { get; set; } + + public RankEvalMetricMeanReciprocalRankDescriptor k(int? k) + { + kValue = k; + return Self; + } + + public RankEvalMetricMeanReciprocalRankDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) + { + RelevantRatingThresholdValue = relevantRatingThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (kValue.HasValue) + { + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue.Value); + } + + if (RelevantRatingThresholdValue.HasValue) + { + writer.WritePropertyName("relevant_rating_threshold"); + writer.WriteNumberValue(RelevantRatingThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs new file mode 100644 index 00000000000..e06858843f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +/// +/// Precision at K (P@k) +/// +public sealed partial class RankEvalMetricPrecision +{ + /// + /// Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant. + /// + [JsonInclude, JsonPropertyName("ignore_unlabeled")] + public bool? IgnoreUnlabeled { get; set; } + [JsonInclude, JsonPropertyName("k")] + public int? k { get; set; } + [JsonInclude, JsonPropertyName("relevant_rating_threshold")] + public int? RelevantRatingThreshold { get; set; } +} + +/// +/// Precision at K (P@k) +/// +public sealed partial class RankEvalMetricPrecisionDescriptor : SerializableDescriptor +{ + internal RankEvalMetricPrecisionDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricPrecisionDescriptor() : base() + { + } + + private bool? IgnoreUnlabeledValue { get; set; } + private int? kValue { get; set; } + private int? RelevantRatingThresholdValue { get; set; } + + /// + /// Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant. + /// + public RankEvalMetricPrecisionDescriptor IgnoreUnlabeled(bool? ignoreUnlabeled = true) + { + IgnoreUnlabeledValue = ignoreUnlabeled; + return Self; + } + + public RankEvalMetricPrecisionDescriptor k(int? k) + { + kValue = k; + return Self; + } + + public RankEvalMetricPrecisionDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) + { + RelevantRatingThresholdValue = relevantRatingThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IgnoreUnlabeledValue.HasValue) + { + writer.WritePropertyName("ignore_unlabeled"); + writer.WriteBooleanValue(IgnoreUnlabeledValue.Value); + } + + if (kValue.HasValue) + { + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue.Value); + } + + if (RelevantRatingThresholdValue.HasValue) + { + writer.WritePropertyName("relevant_rating_threshold"); + writer.WriteNumberValue(RelevantRatingThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs new file mode 100644 index 00000000000..e5e9140cec8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs @@ -0,0 +1,84 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +/// +/// Recall at K (R@k) +/// +public sealed partial class RankEvalMetricRecall +{ + [JsonInclude, JsonPropertyName("k")] + public int? k { get; set; } + [JsonInclude, JsonPropertyName("relevant_rating_threshold")] + public int? RelevantRatingThreshold { get; set; } +} + +/// +/// Recall at K (R@k) +/// +public sealed partial class RankEvalMetricRecallDescriptor : SerializableDescriptor +{ + internal RankEvalMetricRecallDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalMetricRecallDescriptor() : base() + { + } + + private int? kValue { get; set; } + private int? RelevantRatingThresholdValue { get; set; } + + public RankEvalMetricRecallDescriptor k(int? k) + { + kValue = k; + return Self; + } + + public RankEvalMetricRecallDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) + { + RelevantRatingThresholdValue = relevantRatingThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (kValue.HasValue) + { + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue.Value); + } + + if (RelevantRatingThresholdValue.HasValue) + { + writer.WritePropertyName("relevant_rating_threshold"); + writer.WriteNumberValue(RelevantRatingThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs new file mode 100644 index 00000000000..59229ceddb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalQuery +{ + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } +} + +public sealed partial class RankEvalQueryDescriptor : SerializableDescriptor> +{ + internal RankEvalQueryDescriptor(Action> configure) => configure.Invoke(this); + + public RankEvalQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private int? SizeValue { get; set; } + + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RankEvalQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public RankEvalQueryDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RankEvalQueryDescriptor : SerializableDescriptor +{ + internal RankEvalQueryDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private int? SizeValue { get; set; } + + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RankEvalQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public RankEvalQueryDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs new file mode 100644 index 00000000000..184db8e7612 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs @@ -0,0 +1,421 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class RankEvalRequestItem +{ + /// + /// The search request’s ID, used to group result details later. + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// The search template parameters. + /// + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + + /// + /// List of document ratings + /// + [JsonInclude, JsonPropertyName("ratings")] + public ICollection Ratings { get; set; } + + /// + /// The query being evaluated. + /// + [JsonInclude, JsonPropertyName("request")] + public Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQuery? Request { get; set; } + + /// + /// The search template Id + /// + [JsonInclude, JsonPropertyName("template_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? TemplateId { get; set; } +} + +public sealed partial class RankEvalRequestItemDescriptor : SerializableDescriptor> +{ + internal RankEvalRequestItemDescriptor(Action> configure) => configure.Invoke(this); + + public RankEvalRequestItemDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQuery? RequestValue { get; set; } + private RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action> RequestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private ICollection RatingsValue { get; set; } + private DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? TemplateIdValue { get; set; } + + /// + /// The query being evaluated. + /// + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQuery? request) + { + RequestDescriptor = null; + RequestDescriptorAction = null; + RequestValue = request; + return Self; + } + + public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + { + RequestValue = null; + RequestDescriptorAction = null; + RequestDescriptor = descriptor; + return Self; + } + + public RankEvalRequestItemDescriptor Request(Action> configure) + { + RequestValue = null; + RequestDescriptor = null; + RequestDescriptorAction = configure; + return Self; + } + + /// + /// The search request’s ID, used to group result details later. + /// + public RankEvalRequestItemDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The search template parameters. + /// + public RankEvalRequestItemDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// List of document ratings + /// + public RankEvalRequestItemDescriptor Ratings(ICollection ratings) + { + RatingsDescriptor = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = null; + RatingsValue = ratings; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(DocumentRatingDescriptor descriptor) + { + RatingsValue = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = null; + RatingsDescriptor = descriptor; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(Action configure) + { + RatingsValue = null; + RatingsDescriptor = null; + RatingsDescriptorActions = null; + RatingsDescriptorAction = configure; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) + { + RatingsValue = null; + RatingsDescriptor = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = configure; + return Self; + } + + /// + /// The search template Id + /// + public RankEvalRequestItemDescriptor TemplateId(Elastic.Clients.Elasticsearch.Serverless.Id? templateId) + { + TemplateIdValue = templateId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestDescriptor is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, RequestDescriptor, options); + } + else if (RequestDescriptorAction is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + } + else if (RequestValue is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, RequestValue, options); + } + + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (RatingsDescriptor is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RatingsDescriptor, options); + writer.WriteEndArray(); + } + else if (RatingsDescriptorAction is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RatingsDescriptorActions is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + foreach (var action in RatingsDescriptorActions) + { + JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("ratings"); + JsonSerializer.Serialize(writer, RatingsValue, options); + } + + if (TemplateIdValue is not null) + { + writer.WritePropertyName("template_id"); + JsonSerializer.Serialize(writer, TemplateIdValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RankEvalRequestItemDescriptor : SerializableDescriptor +{ + internal RankEvalRequestItemDescriptor(Action configure) => configure.Invoke(this); + + public RankEvalRequestItemDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQuery? RequestValue { get; set; } + private RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action RequestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private ICollection RatingsValue { get; set; } + private DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? TemplateIdValue { get; set; } + + /// + /// The query being evaluated. + /// + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQuery? request) + { + RequestDescriptor = null; + RequestDescriptorAction = null; + RequestValue = request; + return Self; + } + + public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + { + RequestValue = null; + RequestDescriptorAction = null; + RequestDescriptor = descriptor; + return Self; + } + + public RankEvalRequestItemDescriptor Request(Action configure) + { + RequestValue = null; + RequestDescriptor = null; + RequestDescriptorAction = configure; + return Self; + } + + /// + /// The search request’s ID, used to group result details later. + /// + public RankEvalRequestItemDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The search template parameters. + /// + public RankEvalRequestItemDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// List of document ratings + /// + public RankEvalRequestItemDescriptor Ratings(ICollection ratings) + { + RatingsDescriptor = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = null; + RatingsValue = ratings; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(DocumentRatingDescriptor descriptor) + { + RatingsValue = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = null; + RatingsDescriptor = descriptor; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(Action configure) + { + RatingsValue = null; + RatingsDescriptor = null; + RatingsDescriptorActions = null; + RatingsDescriptorAction = configure; + return Self; + } + + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) + { + RatingsValue = null; + RatingsDescriptor = null; + RatingsDescriptorAction = null; + RatingsDescriptorActions = configure; + return Self; + } + + /// + /// The search template Id + /// + public RankEvalRequestItemDescriptor TemplateId(Elastic.Clients.Elasticsearch.Serverless.Id? templateId) + { + TemplateIdValue = templateId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestDescriptor is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, RequestDescriptor, options); + } + else if (RequestDescriptorAction is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + } + else if (RequestValue is not null) + { + writer.WritePropertyName("request"); + JsonSerializer.Serialize(writer, RequestValue, options); + } + + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (RatingsDescriptor is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RatingsDescriptor, options); + writer.WriteEndArray(); + } + else if (RatingsDescriptorAction is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RatingsDescriptorActions is not null) + { + writer.WritePropertyName("ratings"); + writer.WriteStartArray(); + foreach (var action in RatingsDescriptorActions) + { + JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("ratings"); + JsonSerializer.Serialize(writer, RatingsValue, options); + } + + if (TemplateIdValue is not null) + { + writer.WritePropertyName("template_id"); + JsonSerializer.Serialize(writer, TemplateIdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/UnratedDocument.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/UnratedDocument.g.cs new file mode 100644 index 00000000000..b7c4bc85690 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/UnratedDocument.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; + +public sealed partial class UnratedDocument +{ + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationBreakdown.g.cs new file mode 100644 index 00000000000..107bf6b83d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationBreakdown.g.cs @@ -0,0 +1,56 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class AggregationBreakdown +{ + [JsonInclude, JsonPropertyName("build_aggregation")] + public long BuildAggregation { get; init; } + [JsonInclude, JsonPropertyName("build_aggregation_count")] + public long BuildAggregationCount { get; init; } + [JsonInclude, JsonPropertyName("build_leaf_collector")] + public long BuildLeafCollector { get; init; } + [JsonInclude, JsonPropertyName("build_leaf_collector_count")] + public long BuildLeafCollectorCount { get; init; } + [JsonInclude, JsonPropertyName("collect")] + public long Collect { get; init; } + [JsonInclude, JsonPropertyName("collect_count")] + public long CollectCount { get; init; } + [JsonInclude, JsonPropertyName("initialize")] + public long Initialize { get; init; } + [JsonInclude, JsonPropertyName("initialize_count")] + public long InitializeCount { get; init; } + [JsonInclude, JsonPropertyName("post_collection")] + public long? PostCollection { get; init; } + [JsonInclude, JsonPropertyName("post_collection_count")] + public long? PostCollectionCount { get; init; } + [JsonInclude, JsonPropertyName("reduce")] + public long Reduce { get; init; } + [JsonInclude, JsonPropertyName("reduce_count")] + public long ReduceCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfile.g.cs new file mode 100644 index 00000000000..059def04a40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfile.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class AggregationProfile +{ + [JsonInclude, JsonPropertyName("breakdown")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.AggregationBreakdown Breakdown { get; init; } + [JsonInclude, JsonPropertyName("children")] + public IReadOnlyCollection? Children { get; init; } + [JsonInclude, JsonPropertyName("debug")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.AggregationProfileDebug? Debug { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("time_in_nanos")] + public long TimeInNanos { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs new file mode 100644 index 00000000000..18394575b9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class AggregationProfileDebug +{ + [JsonInclude, JsonPropertyName("built_buckets")] + public int? BuiltBuckets { get; init; } + [JsonInclude, JsonPropertyName("chars_fetched")] + public int? CharsFetched { get; init; } + [JsonInclude, JsonPropertyName("collect_analyzed_count")] + public int? CollectAnalyzedCount { get; init; } + [JsonInclude, JsonPropertyName("collect_analyzed_ns")] + public int? CollectAnalyzedNs { get; init; } + [JsonInclude, JsonPropertyName("collection_strategy")] + public string? CollectionStrategy { get; init; } + [JsonInclude, JsonPropertyName("deferred_aggregators")] + public IReadOnlyCollection? DeferredAggregators { get; init; } + [JsonInclude, JsonPropertyName("delegate")] + public string? Delegate { get; init; } + [JsonInclude, JsonPropertyName("delegate_debug")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.AggregationProfileDebug? DelegateDebug { get; init; } + [JsonInclude, JsonPropertyName("empty_collectors_used")] + public int? EmptyCollectorsUsed { get; init; } + [JsonInclude, JsonPropertyName("extract_count")] + public int? ExtractCount { get; init; } + [JsonInclude, JsonPropertyName("extract_ns")] + public int? ExtractNs { get; init; } + [JsonInclude, JsonPropertyName("filters")] + public IReadOnlyCollection? Filters { get; init; } + [JsonInclude, JsonPropertyName("has_filter")] + public bool? HasFilter { get; init; } + [JsonInclude, JsonPropertyName("map_reducer")] + public string? MapReducer { get; init; } + [JsonInclude, JsonPropertyName("numeric_collectors_used")] + public int? NumericCollectorsUsed { get; init; } + [JsonInclude, JsonPropertyName("ordinals_collectors_overhead_too_high")] + public int? OrdinalsCollectorsOverheadTooHigh { get; init; } + [JsonInclude, JsonPropertyName("ordinals_collectors_used")] + public int? OrdinalsCollectorsUsed { get; init; } + [JsonInclude, JsonPropertyName("result_strategy")] + public string? ResultStrategy { get; init; } + [JsonInclude, JsonPropertyName("segments_collected")] + public int? SegmentsCollected { get; init; } + [JsonInclude, JsonPropertyName("segments_counted")] + public int? SegmentsCounted { get; init; } + [JsonInclude, JsonPropertyName("segments_with_deleted_docs")] + public int? SegmentsWithDeletedDocs { get; init; } + [JsonInclude, JsonPropertyName("segments_with_doc_count_field")] + public int? SegmentsWithDocCountField { get; init; } + [JsonInclude, JsonPropertyName("segments_with_multi_valued_ords")] + public int? SegmentsWithMultiValuedOrds { get; init; } + [JsonInclude, JsonPropertyName("segments_with_single_valued_ords")] + public int? SegmentsWithSingleValuedOrds { get; init; } + [JsonInclude, JsonPropertyName("string_hashing_collectors_used")] + public int? StringHashingCollectorsUsed { get; init; } + [JsonInclude, JsonPropertyName("surviving_buckets")] + public int? SurvivingBuckets { get; init; } + [JsonInclude, JsonPropertyName("total_buckets")] + public int? TotalBuckets { get; init; } + [JsonInclude, JsonPropertyName("values_fetched")] + public int? ValuesFetched { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs new file mode 100644 index 00000000000..8aa572d5f82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class AggregationProfileDelegateDebugFilter +{ + [JsonInclude, JsonPropertyName("query")] + public string? Query { get; init; } + [JsonInclude, JsonPropertyName("results_from_metadata")] + public int? ResultsFromMetadata { get; init; } + [JsonInclude, JsonPropertyName("segments_counted_in_constant_time")] + public int? SegmentsCountedInConstantTime { get; init; } + [JsonInclude, JsonPropertyName("specialized_for")] + public string? SpecializedFor { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Collector.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Collector.g.cs new file mode 100644 index 00000000000..ff5d14a7392 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Collector.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Collector +{ + [JsonInclude, JsonPropertyName("children")] + public IReadOnlyCollection? Children { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + [JsonInclude, JsonPropertyName("time_in_nanos")] + public long TimeInNanos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionContext.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionContext.g.cs new file mode 100644 index 00000000000..0e668c19cb9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionContext.g.cs @@ -0,0 +1,119 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class CompletionContext +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("context")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Context Context { get; set; } + [JsonInclude, JsonPropertyName("neighbours")] + public ICollection? Neighbours { get; set; } + [JsonInclude, JsonPropertyName("precision")] + public Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? Precision { get; set; } + [JsonInclude, JsonPropertyName("prefix")] + public bool? Prefix { get; set; } +} + +public sealed partial class CompletionContextDescriptor : SerializableDescriptor +{ + internal CompletionContextDescriptor(Action configure) => configure.Invoke(this); + + public CompletionContextDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Context ContextValue { get; set; } + private ICollection? NeighboursValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? PrecisionValue { get; set; } + private bool? PrefixValue { get; set; } + + public CompletionContextDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public CompletionContextDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Context context) + { + ContextValue = context; + return Self; + } + + public CompletionContextDescriptor Neighbours(ICollection? neighbours) + { + NeighboursValue = neighbours; + return Self; + } + + public CompletionContextDescriptor Precision(Elastic.Clients.Elasticsearch.Serverless.GeohashPrecision? precision) + { + PrecisionValue = precision; + return Self; + } + + public CompletionContextDescriptor Prefix(bool? prefix = true) + { + PrefixValue = prefix; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("context"); + JsonSerializer.Serialize(writer, ContextValue, options); + if (NeighboursValue is not null) + { + writer.WritePropertyName("neighbours"); + JsonSerializer.Serialize(writer, NeighboursValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + if (PrefixValue.HasValue) + { + writer.WritePropertyName("prefix"); + writer.WriteBooleanValue(PrefixValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggester.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggester.g.cs new file mode 100644 index 00000000000..08c4942f65f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggester.g.cs @@ -0,0 +1,392 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class CompletionSuggester +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("contexts")] + public IDictionary>? Contexts { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("fuzzy")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzziness? Fuzzy { get; set; } + [JsonInclude, JsonPropertyName("regex")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? Regex { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + [JsonInclude, JsonPropertyName("skip_duplicates")] + public bool? SkipDuplicates { get; set; } + + public static implicit operator FieldSuggester(CompletionSuggester completionSuggester) => Core.Search.FieldSuggester.Completion(completionSuggester); +} + +public sealed partial class CompletionSuggesterDescriptor : SerializableDescriptor> +{ + internal CompletionSuggesterDescriptor(Action> configure) => configure.Invoke(this); + + public CompletionSuggesterDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private IDictionary>? ContextsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzziness? FuzzyValue { get; set; } + private SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } + private Action FuzzyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? RegexValue { get; set; } + private RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } + private int? SizeValue { get; set; } + private bool? SkipDuplicatesValue { get; set; } + + public CompletionSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + { + ContextsValue = selector?.Invoke(new FluentDictionary>()); + return Self; + } + + public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public CompletionSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzziness? fuzzy) + { + FuzzyDescriptor = null; + FuzzyDescriptorAction = null; + FuzzyValue = fuzzy; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + { + FuzzyValue = null; + FuzzyDescriptorAction = null; + FuzzyDescriptor = descriptor; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(Action configure) + { + FuzzyValue = null; + FuzzyDescriptor = null; + FuzzyDescriptorAction = configure; + return Self; + } + + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? regex) + { + RegexDescriptor = null; + RegexDescriptorAction = null; + RegexValue = regex; + return Self; + } + + public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + { + RegexValue = null; + RegexDescriptorAction = null; + RegexDescriptor = descriptor; + return Self; + } + + public CompletionSuggesterDescriptor Regex(Action configure) + { + RegexValue = null; + RegexDescriptor = null; + RegexDescriptorAction = configure; + return Self; + } + + public CompletionSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public CompletionSuggesterDescriptor SkipDuplicates(bool? skipDuplicates = true) + { + SkipDuplicatesValue = skipDuplicates; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (ContextsValue is not null) + { + writer.WritePropertyName("contexts"); + JsonSerializer.Serialize(writer, ContextsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (FuzzyDescriptor is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, FuzzyDescriptor, options); + } + else if (FuzzyDescriptorAction is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + } + else if (FuzzyValue is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, FuzzyValue, options); + } + + if (RegexDescriptor is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, RegexDescriptor, options); + } + else if (RegexDescriptorAction is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + } + else if (RegexValue is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, RegexValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SkipDuplicatesValue.HasValue) + { + writer.WritePropertyName("skip_duplicates"); + writer.WriteBooleanValue(SkipDuplicatesValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompletionSuggesterDescriptor : SerializableDescriptor +{ + internal CompletionSuggesterDescriptor(Action configure) => configure.Invoke(this); + + public CompletionSuggesterDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private IDictionary>? ContextsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzziness? FuzzyValue { get; set; } + private SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } + private Action FuzzyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? RegexValue { get; set; } + private RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } + private int? SizeValue { get; set; } + private bool? SkipDuplicatesValue { get; set; } + + public CompletionSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + { + ContextsValue = selector?.Invoke(new FluentDictionary>()); + return Self; + } + + public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public CompletionSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompletionSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzziness? fuzzy) + { + FuzzyDescriptor = null; + FuzzyDescriptorAction = null; + FuzzyValue = fuzzy; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + { + FuzzyValue = null; + FuzzyDescriptorAction = null; + FuzzyDescriptor = descriptor; + return Self; + } + + public CompletionSuggesterDescriptor Fuzzy(Action configure) + { + FuzzyValue = null; + FuzzyDescriptor = null; + FuzzyDescriptorAction = configure; + return Self; + } + + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? regex) + { + RegexDescriptor = null; + RegexDescriptorAction = null; + RegexValue = regex; + return Self; + } + + public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + { + RegexValue = null; + RegexDescriptorAction = null; + RegexDescriptor = descriptor; + return Self; + } + + public CompletionSuggesterDescriptor Regex(Action configure) + { + RegexValue = null; + RegexDescriptor = null; + RegexDescriptorAction = configure; + return Self; + } + + public CompletionSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public CompletionSuggesterDescriptor SkipDuplicates(bool? skipDuplicates = true) + { + SkipDuplicatesValue = skipDuplicates; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (ContextsValue is not null) + { + writer.WritePropertyName("contexts"); + JsonSerializer.Serialize(writer, ContextsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (FuzzyDescriptor is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, FuzzyDescriptor, options); + } + else if (FuzzyDescriptorAction is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + } + else if (FuzzyValue is not null) + { + writer.WritePropertyName("fuzzy"); + JsonSerializer.Serialize(writer, FuzzyValue, options); + } + + if (RegexDescriptor is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, RegexDescriptor, options); + } + else if (RegexDescriptorAction is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + } + else if (RegexValue is not null) + { + writer.WritePropertyName("regex"); + JsonSerializer.Serialize(writer, RegexValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SkipDuplicatesValue.HasValue) + { + writer.WritePropertyName("skip_duplicates"); + writer.WriteBooleanValue(SkipDuplicatesValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/DirectGenerator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/DirectGenerator.g.cs new file mode 100644 index 00000000000..abdcd495c3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/DirectGenerator.g.cs @@ -0,0 +1,382 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class DirectGenerator +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("max_edits")] + public int? MaxEdits { get; set; } + [JsonInclude, JsonPropertyName("max_inspections")] + public float? MaxInspections { get; set; } + [JsonInclude, JsonPropertyName("max_term_freq")] + public float? MaxTermFreq { get; set; } + [JsonInclude, JsonPropertyName("min_doc_freq")] + public float? MinDocFreq { get; set; } + [JsonInclude, JsonPropertyName("min_word_length")] + public int? MinWordLength { get; set; } + [JsonInclude, JsonPropertyName("post_filter")] + public string? PostFilter { get; set; } + [JsonInclude, JsonPropertyName("pre_filter")] + public string? PreFilter { get; set; } + [JsonInclude, JsonPropertyName("prefix_length")] + public int? PrefixLength { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + [JsonInclude, JsonPropertyName("suggest_mode")] + public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get; set; } +} + +public sealed partial class DirectGeneratorDescriptor : SerializableDescriptor> +{ + internal DirectGeneratorDescriptor(Action> configure) => configure.Invoke(this); + + public DirectGeneratorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxEditsValue { get; set; } + private float? MaxInspectionsValue { get; set; } + private float? MaxTermFreqValue { get; set; } + private float? MinDocFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private string? PostFilterValue { get; set; } + private string? PreFilterValue { get; set; } + private int? PrefixLengthValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } + + public DirectGeneratorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DirectGeneratorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DirectGeneratorDescriptor MaxEdits(int? maxEdits) + { + MaxEditsValue = maxEdits; + return Self; + } + + public DirectGeneratorDescriptor MaxInspections(float? maxInspections) + { + MaxInspectionsValue = maxInspections; + return Self; + } + + public DirectGeneratorDescriptor MaxTermFreq(float? maxTermFreq) + { + MaxTermFreqValue = maxTermFreq; + return Self; + } + + public DirectGeneratorDescriptor MinDocFreq(float? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + public DirectGeneratorDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + public DirectGeneratorDescriptor PostFilter(string? postFilter) + { + PostFilterValue = postFilter; + return Self; + } + + public DirectGeneratorDescriptor PreFilter(string? preFilter) + { + PreFilterValue = preFilter; + return Self; + } + + public DirectGeneratorDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + public DirectGeneratorDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public DirectGeneratorDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) + { + SuggestModeValue = suggestMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxEditsValue.HasValue) + { + writer.WritePropertyName("max_edits"); + writer.WriteNumberValue(MaxEditsValue.Value); + } + + if (MaxInspectionsValue.HasValue) + { + writer.WritePropertyName("max_inspections"); + writer.WriteNumberValue(MaxInspectionsValue.Value); + } + + if (MaxTermFreqValue.HasValue) + { + writer.WritePropertyName("max_term_freq"); + writer.WriteNumberValue(MaxTermFreqValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (!string.IsNullOrEmpty(PostFilterValue)) + { + writer.WritePropertyName("post_filter"); + writer.WriteStringValue(PostFilterValue); + } + + if (!string.IsNullOrEmpty(PreFilterValue)) + { + writer.WritePropertyName("pre_filter"); + writer.WriteStringValue(PreFilterValue); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SuggestModeValue is not null) + { + writer.WritePropertyName("suggest_mode"); + JsonSerializer.Serialize(writer, SuggestModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DirectGeneratorDescriptor : SerializableDescriptor +{ + internal DirectGeneratorDescriptor(Action configure) => configure.Invoke(this); + + public DirectGeneratorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxEditsValue { get; set; } + private float? MaxInspectionsValue { get; set; } + private float? MaxTermFreqValue { get; set; } + private float? MinDocFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private string? PostFilterValue { get; set; } + private string? PreFilterValue { get; set; } + private int? PrefixLengthValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } + + public DirectGeneratorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DirectGeneratorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DirectGeneratorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DirectGeneratorDescriptor MaxEdits(int? maxEdits) + { + MaxEditsValue = maxEdits; + return Self; + } + + public DirectGeneratorDescriptor MaxInspections(float? maxInspections) + { + MaxInspectionsValue = maxInspections; + return Self; + } + + public DirectGeneratorDescriptor MaxTermFreq(float? maxTermFreq) + { + MaxTermFreqValue = maxTermFreq; + return Self; + } + + public DirectGeneratorDescriptor MinDocFreq(float? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + public DirectGeneratorDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + public DirectGeneratorDescriptor PostFilter(string? postFilter) + { + PostFilterValue = postFilter; + return Self; + } + + public DirectGeneratorDescriptor PreFilter(string? preFilter) + { + PreFilterValue = preFilter; + return Self; + } + + public DirectGeneratorDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + public DirectGeneratorDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public DirectGeneratorDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) + { + SuggestModeValue = suggestMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxEditsValue.HasValue) + { + writer.WritePropertyName("max_edits"); + writer.WriteNumberValue(MaxEditsValue.Value); + } + + if (MaxInspectionsValue.HasValue) + { + writer.WritePropertyName("max_inspections"); + writer.WriteNumberValue(MaxInspectionsValue.Value); + } + + if (MaxTermFreqValue.HasValue) + { + writer.WritePropertyName("max_term_freq"); + writer.WriteNumberValue(MaxTermFreqValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (!string.IsNullOrEmpty(PostFilterValue)) + { + writer.WritePropertyName("post_filter"); + writer.WriteStringValue(PostFilterValue); + } + + if (!string.IsNullOrEmpty(PreFilterValue)) + { + writer.WritePropertyName("pre_filter"); + writer.WriteStringValue(PreFilterValue); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SuggestModeValue is not null) + { + writer.WritePropertyName("suggest_mode"); + JsonSerializer.Serialize(writer, SuggestModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfile.g.cs new file mode 100644 index 00000000000..087f0625db9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfile.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class FetchProfile +{ + [JsonInclude, JsonPropertyName("breakdown")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FetchProfileBreakdown Breakdown { get; init; } + [JsonInclude, JsonPropertyName("children")] + public IReadOnlyCollection? Children { get; init; } + [JsonInclude, JsonPropertyName("debug")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FetchProfileDebug? Debug { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("time_in_nanos")] + public long TimeInNanos { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs new file mode 100644 index 00000000000..4242883cc7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs @@ -0,0 +1,48 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class FetchProfileBreakdown +{ + [JsonInclude, JsonPropertyName("load_source")] + public int? LoadSource { get; init; } + [JsonInclude, JsonPropertyName("load_source_count")] + public int? LoadSourceCount { get; init; } + [JsonInclude, JsonPropertyName("load_stored_fields")] + public int? LoadStoredFields { get; init; } + [JsonInclude, JsonPropertyName("load_stored_fields_count")] + public int? LoadStoredFieldsCount { get; init; } + [JsonInclude, JsonPropertyName("next_reader")] + public int? NextReader { get; init; } + [JsonInclude, JsonPropertyName("next_reader_count")] + public int? NextReaderCount { get; init; } + [JsonInclude, JsonPropertyName("process")] + public int? Process { get; init; } + [JsonInclude, JsonPropertyName("process_count")] + public int? ProcessCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileDebug.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileDebug.g.cs new file mode 100644 index 00000000000..d41b30420cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FetchProfileDebug.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class FetchProfileDebug +{ + [JsonInclude, JsonPropertyName("fast_path")] + public int? FastPath { get; init; } + [JsonInclude, JsonPropertyName("stored_fields")] + public IReadOnlyCollection? StoredFields { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldCollapse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldCollapse.g.cs new file mode 100644 index 00000000000..1e48890222e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldCollapse.g.cs @@ -0,0 +1,397 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class FieldCollapse +{ + [JsonInclude, JsonPropertyName("collapse")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } + + /// + /// The field to collapse the result set on + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The number of inner hits and their sort order + /// + [JsonInclude, JsonPropertyName("inner_hits"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits))] + public ICollection? InnerHits { get; set; } + + /// + /// The number of concurrent requests allowed to retrieve the inner_hits per group + /// + [JsonInclude, JsonPropertyName("max_concurrent_group_searches")] + public int? MaxConcurrentGroupSearches { get; set; } +} + +public sealed partial class FieldCollapseDescriptor : SerializableDescriptor> +{ + internal FieldCollapseDescriptor(Action> configure) => configure.Invoke(this); + + public FieldCollapseDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } + private ICollection? InnerHitsValue { get; set; } + private InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Action>[] InnerHitsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxConcurrentGroupSearchesValue { get; set; } + + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public FieldCollapseDescriptor Collapse(Action> configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// The number of inner hits and their sort order + /// + public FieldCollapseDescriptor InnerHits(ICollection? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = null; + InnerHitsValue = innerHits; + return Self; + } + + public FieldCollapseDescriptor InnerHits(InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public FieldCollapseDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorActions = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + public FieldCollapseDescriptor InnerHits(params Action>[] configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = configure; + return Self; + } + + /// + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The number of concurrent requests allowed to retrieve the inner_hits per group + /// + public FieldCollapseDescriptor MaxConcurrentGroupSearches(int? maxConcurrentGroupSearches) + { + MaxConcurrentGroupSearchesValue = maxConcurrentGroupSearches; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsDescriptorActions is not null) + { + writer.WritePropertyName("inner_hits"); + if (InnerHitsDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in InnerHitsDescriptorActions) + { + JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + } + + if (InnerHitsDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + SingleOrManySerializationHelper.Serialize(InnerHitsValue, writer, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxConcurrentGroupSearchesValue.HasValue) + { + writer.WritePropertyName("max_concurrent_group_searches"); + writer.WriteNumberValue(MaxConcurrentGroupSearchesValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FieldCollapseDescriptor : SerializableDescriptor +{ + internal FieldCollapseDescriptor(Action configure) => configure.Invoke(this); + + public FieldCollapseDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } + private ICollection? InnerHitsValue { get; set; } + private InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Action[] InnerHitsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxConcurrentGroupSearchesValue { get; set; } + + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public FieldCollapseDescriptor Collapse(Action configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + /// + /// The number of inner hits and their sort order + /// + public FieldCollapseDescriptor InnerHits(ICollection? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = null; + InnerHitsValue = innerHits; + return Self; + } + + public FieldCollapseDescriptor InnerHits(InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public FieldCollapseDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorActions = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + public FieldCollapseDescriptor InnerHits(params Action[] configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptorActions = configure; + return Self; + } + + /// + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The number of concurrent requests allowed to retrieve the inner_hits per group + /// + public FieldCollapseDescriptor MaxConcurrentGroupSearches(int? maxConcurrentGroupSearches) + { + MaxConcurrentGroupSearchesValue = maxConcurrentGroupSearches; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsDescriptorActions is not null) + { + writer.WritePropertyName("inner_hits"); + if (InnerHitsDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in InnerHitsDescriptorActions) + { + JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + } + + if (InnerHitsDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + SingleOrManySerializationHelper.Serialize(InnerHitsValue, writer, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxConcurrentGroupSearchesValue.HasValue) + { + writer.WritePropertyName("max_concurrent_group_searches"); + writer.WriteNumberValue(MaxConcurrentGroupSearchesValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldSuggester.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldSuggester.g.cs new file mode 100644 index 00000000000..3bc8a715cef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/FieldSuggester.g.cs @@ -0,0 +1,377 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +[JsonConverter(typeof(FieldSuggesterConverter))] +public sealed partial class FieldSuggester +{ + internal FieldSuggester(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static FieldSuggester Completion(Elastic.Clients.Elasticsearch.Serverless.Core.Search.CompletionSuggester completionSuggester) => new FieldSuggester("completion", completionSuggester); + public static FieldSuggester Phrase(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggester phraseSuggester) => new FieldSuggester("phrase", phraseSuggester); + public static FieldSuggester Term(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TermSuggester termSuggester) => new FieldSuggester("term", termSuggester); + + [JsonInclude, JsonPropertyName("prefix")] + public string? Prefix { get; set; } + [JsonInclude, JsonPropertyName("regex")] + public string? Regex { get; set; } + [JsonInclude, JsonPropertyName("text")] + public string? Text { get; set; } +} + +internal sealed partial class FieldSuggesterConverter : JsonConverter +{ + public override FieldSuggester Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + object? variantValue = default; + string? variantNameValue = default; + string? prefixValue = default; + string? regexValue = default; + string? textValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "prefix") + { + prefixValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "regex") + { + regexValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "text") + { + textValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "completion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "phrase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'FieldSuggester' from the response."); + } + + reader.Read(); + var result = new FieldSuggester(variantNameValue, variantValue); + result.Prefix = prefixValue; + result.Regex = regexValue; + result.Text = textValue; + return result; + } + + public override void Write(Utf8JsonWriter writer, FieldSuggester value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Prefix)) + { + writer.WritePropertyName("prefix"); + writer.WriteStringValue(value.Prefix); + } + + if (!string.IsNullOrEmpty(value.Regex)) + { + writer.WritePropertyName("regex"); + writer.WriteStringValue(value.Regex); + } + + if (!string.IsNullOrEmpty(value.Text)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(value.Text); + } + + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "completion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.CompletionSuggester)value.Variant, options); + break; + case "phrase": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggester)value.Variant, options); + break; + case "term": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.TermSuggester)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FieldSuggesterDescriptor : SerializableDescriptor> +{ + internal FieldSuggesterDescriptor(Action> configure) => configure.Invoke(this); + + public FieldSuggesterDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private FieldSuggesterDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private FieldSuggesterDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private string? PrefixValue { get; set; } + private string? RegexValue { get; set; } + private string? TextValue { get; set; } + + public FieldSuggesterDescriptor Prefix(string? prefix) + { + PrefixValue = prefix; + return Self; + } + + public FieldSuggesterDescriptor Regex(string? regex) + { + RegexValue = regex; + return Self; + } + + public FieldSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + public FieldSuggesterDescriptor Completion(CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action> configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action> configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action> configure) => Set(configure, "term"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(PrefixValue)) + { + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + } + + if (!string.IsNullOrEmpty(RegexValue)) + { + writer.WritePropertyName("regex"); + writer.WriteStringValue(RegexValue); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FieldSuggesterDescriptor : SerializableDescriptor +{ + internal FieldSuggesterDescriptor(Action configure) => configure.Invoke(this); + + public FieldSuggesterDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private FieldSuggesterDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private FieldSuggesterDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private string? PrefixValue { get; set; } + private string? RegexValue { get; set; } + private string? TextValue { get; set; } + + public FieldSuggesterDescriptor Prefix(string? prefix) + { + PrefixValue = prefix; + return Self; + } + + public FieldSuggesterDescriptor Regex(string? regex) + { + RegexValue = regex; + return Self; + } + + public FieldSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + public FieldSuggesterDescriptor Completion(CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Completion(Action> configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Phrase(Action> configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action configure) => Set(configure, "term"); + public FieldSuggesterDescriptor Term(Action> configure) => Set(configure, "term"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(PrefixValue)) + { + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + } + + if (!string.IsNullOrEmpty(RegexValue)) + { + writer.WritePropertyName("regex"); + writer.WriteStringValue(RegexValue); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Highlight.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Highlight.g.cs new file mode 100644 index 00000000000..a6e8853ae97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Highlight.g.cs @@ -0,0 +1,760 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Highlight +{ + [JsonInclude, JsonPropertyName("boundary_chars")] + public string? BoundaryChars { get; set; } + [JsonInclude, JsonPropertyName("boundary_max_scan")] + public int? BoundaryMaxScan { get; set; } + [JsonInclude, JsonPropertyName("boundary_scanner")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + [JsonInclude, JsonPropertyName("boundary_scanner_locale")] + public string? BoundaryScannerLocale { get; set; } + [JsonInclude, JsonPropertyName("encoder")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterEncoder? Encoder { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public IDictionary Fields { get; set; } + [JsonInclude, JsonPropertyName("force_source")] + public bool? ForceSource { get; set; } + [JsonInclude, JsonPropertyName("fragment_size")] + public int? FragmentSize { get; set; } + [JsonInclude, JsonPropertyName("fragmenter")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } + [JsonInclude, JsonPropertyName("highlight_filter")] + public bool? HighlightFilter { get; set; } + [JsonInclude, JsonPropertyName("highlight_query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQuery { get; set; } + [JsonInclude, JsonPropertyName("max_analyzed_offset")] + public int? MaxAnalyzedOffset { get; set; } + [JsonInclude, JsonPropertyName("max_fragment_length")] + public int? MaxFragmentLength { get; set; } + [JsonInclude, JsonPropertyName("no_match_size")] + public int? NoMatchSize { get; set; } + [JsonInclude, JsonPropertyName("number_of_fragments")] + public int? NumberOfFragments { get; set; } + [JsonInclude, JsonPropertyName("options")] + public IDictionary? Options { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("phrase_limit")] + public int? PhraseLimit { get; set; } + [JsonInclude, JsonPropertyName("post_tags")] + public ICollection? PostTags { get; set; } + [JsonInclude, JsonPropertyName("pre_tags")] + public ICollection? PreTags { get; set; } + [JsonInclude, JsonPropertyName("require_field_match")] + public bool? RequireFieldMatch { get; set; } + [JsonInclude, JsonPropertyName("tags_schema")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? Type { get; set; } +} + +public sealed partial class HighlightDescriptor : SerializableDescriptor> +{ + internal HighlightDescriptor(Action> configure) => configure.Invoke(this); + + public HighlightDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQueryValue { get; set; } + private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } + private string? BoundaryCharsValue { get; set; } + private int? BoundaryMaxScanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } + private string? BoundaryScannerLocaleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterEncoder? EncoderValue { get; set; } + private IDictionary FieldsValue { get; set; } + private bool? ForceSourceValue { get; set; } + private int? FragmentSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } + private bool? HighlightFilterValue { get; set; } + private int? MaxAnalyzedOffsetValue { get; set; } + private int? MaxFragmentLengthValue { get; set; } + private int? NoMatchSizeValue { get; set; } + private int? NumberOfFragmentsValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? OrderValue { get; set; } + private int? PhraseLimitValue { get; set; } + private ICollection? PostTagsValue { get; set; } + private ICollection? PreTagsValue { get; set; } + private bool? RequireFieldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) + { + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = null; + HighlightQueryValue = highlightQuery; + return Self; + } + + public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + { + HighlightQueryValue = null; + HighlightQueryDescriptorAction = null; + HighlightQueryDescriptor = descriptor; + return Self; + } + + public HighlightDescriptor HighlightQuery(Action> configure) + { + HighlightQueryValue = null; + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = configure; + return Self; + } + + public HighlightDescriptor BoundaryChars(string? boundaryChars) + { + BoundaryCharsValue = boundaryChars; + return Self; + } + + public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) + { + BoundaryMaxScanValue = boundaryMaxScan; + return Self; + } + + public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) + { + BoundaryScannerValue = boundaryScanner; + return Self; + } + + public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) + { + BoundaryScannerLocaleValue = boundaryScannerLocale; + return Self; + } + + public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterEncoder? encoder) + { + EncoderValue = encoder; + return Self; + } + + public HighlightDescriptor Fields(Func, FluentDictionary> selector) + { + FieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightDescriptor ForceSource(bool? forceSource = true) + { + ForceSourceValue = forceSource; + return Self; + } + + public HighlightDescriptor FragmentSize(int? fragmentSize) + { + FragmentSizeValue = fragmentSize; + return Self; + } + + public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) + { + FragmenterValue = fragmenter; + return Self; + } + + public HighlightDescriptor HighlightFilter(bool? highlightFilter = true) + { + HighlightFilterValue = highlightFilter; + return Self; + } + + public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) + { + MaxAnalyzedOffsetValue = maxAnalyzedOffset; + return Self; + } + + public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) + { + MaxFragmentLengthValue = maxFragmentLength; + return Self; + } + + public HighlightDescriptor NoMatchSize(int? noMatchSize) + { + NoMatchSizeValue = noMatchSize; + return Self; + } + + public HighlightDescriptor NumberOfFragments(int? numberOfFragments) + { + NumberOfFragmentsValue = numberOfFragments; + return Self; + } + + public HighlightDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) + { + OrderValue = order; + return Self; + } + + public HighlightDescriptor PhraseLimit(int? phraseLimit) + { + PhraseLimitValue = phraseLimit; + return Self; + } + + public HighlightDescriptor PostTags(ICollection? postTags) + { + PostTagsValue = postTags; + return Self; + } + + public HighlightDescriptor PreTags(ICollection? preTags) + { + PreTagsValue = preTags; + return Self; + } + + public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) + { + RequireFieldMatchValue = requireFieldMatch; + return Self; + } + + public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) + { + TagsSchemaValue = tagsSchema; + return Self; + } + + public HighlightDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HighlightQueryDescriptor is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryDescriptor, options); + } + else if (HighlightQueryDescriptorAction is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + } + else if (HighlightQueryValue is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryCharsValue)) + { + writer.WritePropertyName("boundary_chars"); + writer.WriteStringValue(BoundaryCharsValue); + } + + if (BoundaryMaxScanValue.HasValue) + { + writer.WritePropertyName("boundary_max_scan"); + writer.WriteNumberValue(BoundaryMaxScanValue.Value); + } + + if (BoundaryScannerValue is not null) + { + writer.WritePropertyName("boundary_scanner"); + JsonSerializer.Serialize(writer, BoundaryScannerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryScannerLocaleValue)) + { + writer.WritePropertyName("boundary_scanner_locale"); + writer.WriteStringValue(BoundaryScannerLocaleValue); + } + + if (EncoderValue is not null) + { + writer.WritePropertyName("encoder"); + JsonSerializer.Serialize(writer, EncoderValue, options); + } + + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + if (ForceSourceValue.HasValue) + { + writer.WritePropertyName("force_source"); + writer.WriteBooleanValue(ForceSourceValue.Value); + } + + if (FragmentSizeValue.HasValue) + { + writer.WritePropertyName("fragment_size"); + writer.WriteNumberValue(FragmentSizeValue.Value); + } + + if (FragmenterValue is not null) + { + writer.WritePropertyName("fragmenter"); + JsonSerializer.Serialize(writer, FragmenterValue, options); + } + + if (HighlightFilterValue.HasValue) + { + writer.WritePropertyName("highlight_filter"); + writer.WriteBooleanValue(HighlightFilterValue.Value); + } + + if (MaxAnalyzedOffsetValue.HasValue) + { + writer.WritePropertyName("max_analyzed_offset"); + writer.WriteNumberValue(MaxAnalyzedOffsetValue.Value); + } + + if (MaxFragmentLengthValue.HasValue) + { + writer.WritePropertyName("max_fragment_length"); + writer.WriteNumberValue(MaxFragmentLengthValue.Value); + } + + if (NoMatchSizeValue.HasValue) + { + writer.WritePropertyName("no_match_size"); + writer.WriteNumberValue(NoMatchSizeValue.Value); + } + + if (NumberOfFragmentsValue.HasValue) + { + writer.WritePropertyName("number_of_fragments"); + writer.WriteNumberValue(NumberOfFragmentsValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PhraseLimitValue.HasValue) + { + writer.WritePropertyName("phrase_limit"); + writer.WriteNumberValue(PhraseLimitValue.Value); + } + + if (PostTagsValue is not null) + { + writer.WritePropertyName("post_tags"); + JsonSerializer.Serialize(writer, PostTagsValue, options); + } + + if (PreTagsValue is not null) + { + writer.WritePropertyName("pre_tags"); + JsonSerializer.Serialize(writer, PreTagsValue, options); + } + + if (RequireFieldMatchValue.HasValue) + { + writer.WritePropertyName("require_field_match"); + writer.WriteBooleanValue(RequireFieldMatchValue.Value); + } + + if (TagsSchemaValue is not null) + { + writer.WritePropertyName("tags_schema"); + JsonSerializer.Serialize(writer, TagsSchemaValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HighlightDescriptor : SerializableDescriptor +{ + internal HighlightDescriptor(Action configure) => configure.Invoke(this); + + public HighlightDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQueryValue { get; set; } + private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } + private string? BoundaryCharsValue { get; set; } + private int? BoundaryMaxScanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } + private string? BoundaryScannerLocaleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterEncoder? EncoderValue { get; set; } + private IDictionary FieldsValue { get; set; } + private bool? ForceSourceValue { get; set; } + private int? FragmentSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } + private bool? HighlightFilterValue { get; set; } + private int? MaxAnalyzedOffsetValue { get; set; } + private int? MaxFragmentLengthValue { get; set; } + private int? NoMatchSizeValue { get; set; } + private int? NumberOfFragmentsValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? OrderValue { get; set; } + private int? PhraseLimitValue { get; set; } + private ICollection? PostTagsValue { get; set; } + private ICollection? PreTagsValue { get; set; } + private bool? RequireFieldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) + { + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = null; + HighlightQueryValue = highlightQuery; + return Self; + } + + public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + { + HighlightQueryValue = null; + HighlightQueryDescriptorAction = null; + HighlightQueryDescriptor = descriptor; + return Self; + } + + public HighlightDescriptor HighlightQuery(Action configure) + { + HighlightQueryValue = null; + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = configure; + return Self; + } + + public HighlightDescriptor BoundaryChars(string? boundaryChars) + { + BoundaryCharsValue = boundaryChars; + return Self; + } + + public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) + { + BoundaryMaxScanValue = boundaryMaxScan; + return Self; + } + + public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) + { + BoundaryScannerValue = boundaryScanner; + return Self; + } + + public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) + { + BoundaryScannerLocaleValue = boundaryScannerLocale; + return Self; + } + + public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterEncoder? encoder) + { + EncoderValue = encoder; + return Self; + } + + public HighlightDescriptor Fields(Func, FluentDictionary> selector) + { + FieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightDescriptor ForceSource(bool? forceSource = true) + { + ForceSourceValue = forceSource; + return Self; + } + + public HighlightDescriptor FragmentSize(int? fragmentSize) + { + FragmentSizeValue = fragmentSize; + return Self; + } + + public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) + { + FragmenterValue = fragmenter; + return Self; + } + + public HighlightDescriptor HighlightFilter(bool? highlightFilter = true) + { + HighlightFilterValue = highlightFilter; + return Self; + } + + public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) + { + MaxAnalyzedOffsetValue = maxAnalyzedOffset; + return Self; + } + + public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) + { + MaxFragmentLengthValue = maxFragmentLength; + return Self; + } + + public HighlightDescriptor NoMatchSize(int? noMatchSize) + { + NoMatchSizeValue = noMatchSize; + return Self; + } + + public HighlightDescriptor NumberOfFragments(int? numberOfFragments) + { + NumberOfFragmentsValue = numberOfFragments; + return Self; + } + + public HighlightDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) + { + OrderValue = order; + return Self; + } + + public HighlightDescriptor PhraseLimit(int? phraseLimit) + { + PhraseLimitValue = phraseLimit; + return Self; + } + + public HighlightDescriptor PostTags(ICollection? postTags) + { + PostTagsValue = postTags; + return Self; + } + + public HighlightDescriptor PreTags(ICollection? preTags) + { + PreTagsValue = preTags; + return Self; + } + + public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) + { + RequireFieldMatchValue = requireFieldMatch; + return Self; + } + + public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) + { + TagsSchemaValue = tagsSchema; + return Self; + } + + public HighlightDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HighlightQueryDescriptor is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryDescriptor, options); + } + else if (HighlightQueryDescriptorAction is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + } + else if (HighlightQueryValue is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryCharsValue)) + { + writer.WritePropertyName("boundary_chars"); + writer.WriteStringValue(BoundaryCharsValue); + } + + if (BoundaryMaxScanValue.HasValue) + { + writer.WritePropertyName("boundary_max_scan"); + writer.WriteNumberValue(BoundaryMaxScanValue.Value); + } + + if (BoundaryScannerValue is not null) + { + writer.WritePropertyName("boundary_scanner"); + JsonSerializer.Serialize(writer, BoundaryScannerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryScannerLocaleValue)) + { + writer.WritePropertyName("boundary_scanner_locale"); + writer.WriteStringValue(BoundaryScannerLocaleValue); + } + + if (EncoderValue is not null) + { + writer.WritePropertyName("encoder"); + JsonSerializer.Serialize(writer, EncoderValue, options); + } + + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + if (ForceSourceValue.HasValue) + { + writer.WritePropertyName("force_source"); + writer.WriteBooleanValue(ForceSourceValue.Value); + } + + if (FragmentSizeValue.HasValue) + { + writer.WritePropertyName("fragment_size"); + writer.WriteNumberValue(FragmentSizeValue.Value); + } + + if (FragmenterValue is not null) + { + writer.WritePropertyName("fragmenter"); + JsonSerializer.Serialize(writer, FragmenterValue, options); + } + + if (HighlightFilterValue.HasValue) + { + writer.WritePropertyName("highlight_filter"); + writer.WriteBooleanValue(HighlightFilterValue.Value); + } + + if (MaxAnalyzedOffsetValue.HasValue) + { + writer.WritePropertyName("max_analyzed_offset"); + writer.WriteNumberValue(MaxAnalyzedOffsetValue.Value); + } + + if (MaxFragmentLengthValue.HasValue) + { + writer.WritePropertyName("max_fragment_length"); + writer.WriteNumberValue(MaxFragmentLengthValue.Value); + } + + if (NoMatchSizeValue.HasValue) + { + writer.WritePropertyName("no_match_size"); + writer.WriteNumberValue(NoMatchSizeValue.Value); + } + + if (NumberOfFragmentsValue.HasValue) + { + writer.WritePropertyName("number_of_fragments"); + writer.WriteNumberValue(NumberOfFragmentsValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PhraseLimitValue.HasValue) + { + writer.WritePropertyName("phrase_limit"); + writer.WriteNumberValue(PhraseLimitValue.Value); + } + + if (PostTagsValue is not null) + { + writer.WritePropertyName("post_tags"); + JsonSerializer.Serialize(writer, PostTagsValue, options); + } + + if (PreTagsValue is not null) + { + writer.WritePropertyName("pre_tags"); + JsonSerializer.Serialize(writer, PreTagsValue, options); + } + + if (RequireFieldMatchValue.HasValue) + { + writer.WritePropertyName("require_field_match"); + writer.WriteBooleanValue(RequireFieldMatchValue.Value); + } + + if (TagsSchemaValue is not null) + { + writer.WritePropertyName("tags_schema"); + JsonSerializer.Serialize(writer, TagsSchemaValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HighlightField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HighlightField.g.cs new file mode 100644 index 00000000000..ae1ddce56b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HighlightField.g.cs @@ -0,0 +1,796 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class HighlightField +{ + [JsonInclude, JsonPropertyName("analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("boundary_chars")] + public string? BoundaryChars { get; set; } + [JsonInclude, JsonPropertyName("boundary_max_scan")] + public int? BoundaryMaxScan { get; set; } + [JsonInclude, JsonPropertyName("boundary_scanner")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + [JsonInclude, JsonPropertyName("boundary_scanner_locale")] + public string? BoundaryScannerLocale { get; set; } + [JsonInclude, JsonPropertyName("force_source")] + public bool? ForceSource { get; set; } + [JsonInclude, JsonPropertyName("fragment_offset")] + public int? FragmentOffset { get; set; } + [JsonInclude, JsonPropertyName("fragment_size")] + public int? FragmentSize { get; set; } + [JsonInclude, JsonPropertyName("fragmenter")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } + [JsonInclude, JsonPropertyName("highlight_filter")] + public bool? HighlightFilter { get; set; } + [JsonInclude, JsonPropertyName("highlight_query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQuery { get; set; } + [JsonInclude, JsonPropertyName("matched_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFields { get; set; } + [JsonInclude, JsonPropertyName("max_analyzed_offset")] + public int? MaxAnalyzedOffset { get; set; } + [JsonInclude, JsonPropertyName("max_fragment_length")] + public int? MaxFragmentLength { get; set; } + [JsonInclude, JsonPropertyName("no_match_size")] + public int? NoMatchSize { get; set; } + [JsonInclude, JsonPropertyName("number_of_fragments")] + public int? NumberOfFragments { get; set; } + [JsonInclude, JsonPropertyName("options")] + public IDictionary? Options { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("phrase_limit")] + public int? PhraseLimit { get; set; } + [JsonInclude, JsonPropertyName("post_tags")] + public ICollection? PostTags { get; set; } + [JsonInclude, JsonPropertyName("pre_tags")] + public ICollection? PreTags { get; set; } + [JsonInclude, JsonPropertyName("require_field_match")] + public bool? RequireFieldMatch { get; set; } + [JsonInclude, JsonPropertyName("tags_schema")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? Type { get; set; } +} + +public sealed partial class HighlightFieldDescriptor : SerializableDescriptor> +{ + internal HighlightFieldDescriptor(Action> configure) => configure.Invoke(this); + + public HighlightFieldDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQueryValue { get; set; } + private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? AnalyzerValue { get; set; } + private string? BoundaryCharsValue { get; set; } + private int? BoundaryMaxScanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } + private string? BoundaryScannerLocaleValue { get; set; } + private bool? ForceSourceValue { get; set; } + private int? FragmentOffsetValue { get; set; } + private int? FragmentSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } + private bool? HighlightFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFieldsValue { get; set; } + private int? MaxAnalyzedOffsetValue { get; set; } + private int? MaxFragmentLengthValue { get; set; } + private int? NoMatchSizeValue { get; set; } + private int? NumberOfFragmentsValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? OrderValue { get; set; } + private int? PhraseLimitValue { get; set; } + private ICollection? PostTagsValue { get; set; } + private ICollection? PreTagsValue { get; set; } + private bool? RequireFieldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) + { + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = null; + HighlightQueryValue = highlightQuery; + return Self; + } + + public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + { + HighlightQueryValue = null; + HighlightQueryDescriptorAction = null; + HighlightQueryDescriptor = descriptor; + return Self; + } + + public HighlightFieldDescriptor HighlightQuery(Action> configure) + { + HighlightQueryValue = null; + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = configure; + return Self; + } + + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) + { + BoundaryCharsValue = boundaryChars; + return Self; + } + + public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) + { + BoundaryMaxScanValue = boundaryMaxScan; + return Self; + } + + public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) + { + BoundaryScannerValue = boundaryScanner; + return Self; + } + + public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) + { + BoundaryScannerLocaleValue = boundaryScannerLocale; + return Self; + } + + public HighlightFieldDescriptor ForceSource(bool? forceSource = true) + { + ForceSourceValue = forceSource; + return Self; + } + + public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) + { + FragmentOffsetValue = fragmentOffset; + return Self; + } + + public HighlightFieldDescriptor FragmentSize(int? fragmentSize) + { + FragmentSizeValue = fragmentSize; + return Self; + } + + public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) + { + FragmenterValue = fragmenter; + return Self; + } + + public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter = true) + { + HighlightFilterValue = highlightFilter; + return Self; + } + + public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elasticsearch.Serverless.Fields? matchedFields) + { + MatchedFieldsValue = matchedFields; + return Self; + } + + public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) + { + MaxAnalyzedOffsetValue = maxAnalyzedOffset; + return Self; + } + + public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLength) + { + MaxFragmentLengthValue = maxFragmentLength; + return Self; + } + + public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) + { + NoMatchSizeValue = noMatchSize; + return Self; + } + + public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) + { + NumberOfFragmentsValue = numberOfFragments; + return Self; + } + + public HighlightFieldDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) + { + OrderValue = order; + return Self; + } + + public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) + { + PhraseLimitValue = phraseLimit; + return Self; + } + + public HighlightFieldDescriptor PostTags(ICollection? postTags) + { + PostTagsValue = postTags; + return Self; + } + + public HighlightFieldDescriptor PreTags(ICollection? preTags) + { + PreTagsValue = preTags; + return Self; + } + + public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) + { + RequireFieldMatchValue = requireFieldMatch; + return Self; + } + + public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) + { + TagsSchemaValue = tagsSchema; + return Self; + } + + public HighlightFieldDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HighlightQueryDescriptor is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryDescriptor, options); + } + else if (HighlightQueryDescriptorAction is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + } + else if (HighlightQueryValue is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryValue, options); + } + + if (AnalyzerValue is not null) + { + writer.WritePropertyName("analyzer"); + JsonSerializer.Serialize(writer, AnalyzerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryCharsValue)) + { + writer.WritePropertyName("boundary_chars"); + writer.WriteStringValue(BoundaryCharsValue); + } + + if (BoundaryMaxScanValue.HasValue) + { + writer.WritePropertyName("boundary_max_scan"); + writer.WriteNumberValue(BoundaryMaxScanValue.Value); + } + + if (BoundaryScannerValue is not null) + { + writer.WritePropertyName("boundary_scanner"); + JsonSerializer.Serialize(writer, BoundaryScannerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryScannerLocaleValue)) + { + writer.WritePropertyName("boundary_scanner_locale"); + writer.WriteStringValue(BoundaryScannerLocaleValue); + } + + if (ForceSourceValue.HasValue) + { + writer.WritePropertyName("force_source"); + writer.WriteBooleanValue(ForceSourceValue.Value); + } + + if (FragmentOffsetValue.HasValue) + { + writer.WritePropertyName("fragment_offset"); + writer.WriteNumberValue(FragmentOffsetValue.Value); + } + + if (FragmentSizeValue.HasValue) + { + writer.WritePropertyName("fragment_size"); + writer.WriteNumberValue(FragmentSizeValue.Value); + } + + if (FragmenterValue is not null) + { + writer.WritePropertyName("fragmenter"); + JsonSerializer.Serialize(writer, FragmenterValue, options); + } + + if (HighlightFilterValue.HasValue) + { + writer.WritePropertyName("highlight_filter"); + writer.WriteBooleanValue(HighlightFilterValue.Value); + } + + if (MatchedFieldsValue is not null) + { + writer.WritePropertyName("matched_fields"); + JsonSerializer.Serialize(writer, MatchedFieldsValue, options); + } + + if (MaxAnalyzedOffsetValue.HasValue) + { + writer.WritePropertyName("max_analyzed_offset"); + writer.WriteNumberValue(MaxAnalyzedOffsetValue.Value); + } + + if (MaxFragmentLengthValue.HasValue) + { + writer.WritePropertyName("max_fragment_length"); + writer.WriteNumberValue(MaxFragmentLengthValue.Value); + } + + if (NoMatchSizeValue.HasValue) + { + writer.WritePropertyName("no_match_size"); + writer.WriteNumberValue(NoMatchSizeValue.Value); + } + + if (NumberOfFragmentsValue.HasValue) + { + writer.WritePropertyName("number_of_fragments"); + writer.WriteNumberValue(NumberOfFragmentsValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PhraseLimitValue.HasValue) + { + writer.WritePropertyName("phrase_limit"); + writer.WriteNumberValue(PhraseLimitValue.Value); + } + + if (PostTagsValue is not null) + { + writer.WritePropertyName("post_tags"); + JsonSerializer.Serialize(writer, PostTagsValue, options); + } + + if (PreTagsValue is not null) + { + writer.WritePropertyName("pre_tags"); + JsonSerializer.Serialize(writer, PreTagsValue, options); + } + + if (RequireFieldMatchValue.HasValue) + { + writer.WritePropertyName("require_field_match"); + writer.WriteBooleanValue(RequireFieldMatchValue.Value); + } + + if (TagsSchemaValue is not null) + { + writer.WritePropertyName("tags_schema"); + JsonSerializer.Serialize(writer, TagsSchemaValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HighlightFieldDescriptor : SerializableDescriptor +{ + internal HighlightFieldDescriptor(Action configure) => configure.Invoke(this); + + public HighlightFieldDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQueryValue { get; set; } + private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? AnalyzerValue { get; set; } + private string? BoundaryCharsValue { get; set; } + private int? BoundaryMaxScanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } + private string? BoundaryScannerLocaleValue { get; set; } + private bool? ForceSourceValue { get; set; } + private int? FragmentOffsetValue { get; set; } + private int? FragmentSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } + private bool? HighlightFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFieldsValue { get; set; } + private int? MaxAnalyzedOffsetValue { get; set; } + private int? MaxFragmentLengthValue { get; set; } + private int? NoMatchSizeValue { get; set; } + private int? NumberOfFragmentsValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? OrderValue { get; set; } + private int? PhraseLimitValue { get; set; } + private ICollection? PostTagsValue { get; set; } + private ICollection? PreTagsValue { get; set; } + private bool? RequireFieldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) + { + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = null; + HighlightQueryValue = highlightQuery; + return Self; + } + + public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + { + HighlightQueryValue = null; + HighlightQueryDescriptorAction = null; + HighlightQueryDescriptor = descriptor; + return Self; + } + + public HighlightFieldDescriptor HighlightQuery(Action configure) + { + HighlightQueryValue = null; + HighlightQueryDescriptor = null; + HighlightQueryDescriptorAction = configure; + return Self; + } + + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) + { + BoundaryCharsValue = boundaryChars; + return Self; + } + + public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) + { + BoundaryMaxScanValue = boundaryMaxScan; + return Self; + } + + public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) + { + BoundaryScannerValue = boundaryScanner; + return Self; + } + + public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) + { + BoundaryScannerLocaleValue = boundaryScannerLocale; + return Self; + } + + public HighlightFieldDescriptor ForceSource(bool? forceSource = true) + { + ForceSourceValue = forceSource; + return Self; + } + + public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) + { + FragmentOffsetValue = fragmentOffset; + return Self; + } + + public HighlightFieldDescriptor FragmentSize(int? fragmentSize) + { + FragmentSizeValue = fragmentSize; + return Self; + } + + public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) + { + FragmenterValue = fragmenter; + return Self; + } + + public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter = true) + { + HighlightFilterValue = highlightFilter; + return Self; + } + + public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elasticsearch.Serverless.Fields? matchedFields) + { + MatchedFieldsValue = matchedFields; + return Self; + } + + public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) + { + MaxAnalyzedOffsetValue = maxAnalyzedOffset; + return Self; + } + + public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLength) + { + MaxFragmentLengthValue = maxFragmentLength; + return Self; + } + + public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) + { + NoMatchSizeValue = noMatchSize; + return Self; + } + + public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) + { + NumberOfFragmentsValue = numberOfFragments; + return Self; + } + + public HighlightFieldDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) + { + OrderValue = order; + return Self; + } + + public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) + { + PhraseLimitValue = phraseLimit; + return Self; + } + + public HighlightFieldDescriptor PostTags(ICollection? postTags) + { + PostTagsValue = postTags; + return Self; + } + + public HighlightFieldDescriptor PreTags(ICollection? preTags) + { + PreTagsValue = preTags; + return Self; + } + + public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) + { + RequireFieldMatchValue = requireFieldMatch; + return Self; + } + + public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) + { + TagsSchemaValue = tagsSchema; + return Self; + } + + public HighlightFieldDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HighlightQueryDescriptor is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryDescriptor, options); + } + else if (HighlightQueryDescriptorAction is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + } + else if (HighlightQueryValue is not null) + { + writer.WritePropertyName("highlight_query"); + JsonSerializer.Serialize(writer, HighlightQueryValue, options); + } + + if (AnalyzerValue is not null) + { + writer.WritePropertyName("analyzer"); + JsonSerializer.Serialize(writer, AnalyzerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryCharsValue)) + { + writer.WritePropertyName("boundary_chars"); + writer.WriteStringValue(BoundaryCharsValue); + } + + if (BoundaryMaxScanValue.HasValue) + { + writer.WritePropertyName("boundary_max_scan"); + writer.WriteNumberValue(BoundaryMaxScanValue.Value); + } + + if (BoundaryScannerValue is not null) + { + writer.WritePropertyName("boundary_scanner"); + JsonSerializer.Serialize(writer, BoundaryScannerValue, options); + } + + if (!string.IsNullOrEmpty(BoundaryScannerLocaleValue)) + { + writer.WritePropertyName("boundary_scanner_locale"); + writer.WriteStringValue(BoundaryScannerLocaleValue); + } + + if (ForceSourceValue.HasValue) + { + writer.WritePropertyName("force_source"); + writer.WriteBooleanValue(ForceSourceValue.Value); + } + + if (FragmentOffsetValue.HasValue) + { + writer.WritePropertyName("fragment_offset"); + writer.WriteNumberValue(FragmentOffsetValue.Value); + } + + if (FragmentSizeValue.HasValue) + { + writer.WritePropertyName("fragment_size"); + writer.WriteNumberValue(FragmentSizeValue.Value); + } + + if (FragmenterValue is not null) + { + writer.WritePropertyName("fragmenter"); + JsonSerializer.Serialize(writer, FragmenterValue, options); + } + + if (HighlightFilterValue.HasValue) + { + writer.WritePropertyName("highlight_filter"); + writer.WriteBooleanValue(HighlightFilterValue.Value); + } + + if (MatchedFieldsValue is not null) + { + writer.WritePropertyName("matched_fields"); + JsonSerializer.Serialize(writer, MatchedFieldsValue, options); + } + + if (MaxAnalyzedOffsetValue.HasValue) + { + writer.WritePropertyName("max_analyzed_offset"); + writer.WriteNumberValue(MaxAnalyzedOffsetValue.Value); + } + + if (MaxFragmentLengthValue.HasValue) + { + writer.WritePropertyName("max_fragment_length"); + writer.WriteNumberValue(MaxFragmentLengthValue.Value); + } + + if (NoMatchSizeValue.HasValue) + { + writer.WritePropertyName("no_match_size"); + writer.WriteNumberValue(NoMatchSizeValue.Value); + } + + if (NumberOfFragmentsValue.HasValue) + { + writer.WritePropertyName("number_of_fragments"); + writer.WriteNumberValue(NumberOfFragmentsValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PhraseLimitValue.HasValue) + { + writer.WritePropertyName("phrase_limit"); + writer.WriteNumberValue(PhraseLimitValue.Value); + } + + if (PostTagsValue is not null) + { + writer.WritePropertyName("post_tags"); + JsonSerializer.Serialize(writer, PostTagsValue, options); + } + + if (PreTagsValue is not null) + { + writer.WritePropertyName("pre_tags"); + JsonSerializer.Serialize(writer, PreTagsValue, options); + } + + if (RequireFieldMatchValue.HasValue) + { + writer.WritePropertyName("require_field_match"); + writer.WriteBooleanValue(RequireFieldMatchValue.Value); + } + + if (TagsSchemaValue is not null) + { + writer.WritePropertyName("tags_schema"); + JsonSerializer.Serialize(writer, TagsSchemaValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Hit.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Hit.g.cs new file mode 100644 index 00000000000..ece4b89ce34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Hit.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Hit +{ + [JsonInclude, JsonPropertyName("_explanation")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Explain.Explanation? Explanation { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("_ignored")] + public IReadOnlyCollection? Ignored { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("_nested")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.NestedIdentity? Nested { get; init; } + [JsonInclude, JsonPropertyName("_node")] + public string? Node { get; init; } + [JsonInclude, JsonPropertyName("_primary_term")] + public long? PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("_score")] + public double? Score { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_shard")] + public string? Shard { get; init; } + [JsonInclude, JsonPropertyName("_source")] + [SourceConverter] + public TDocument? Source { get; init; } + [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("highlight")] + public IReadOnlyDictionary>? Highlight { get; init; } + [JsonInclude, JsonPropertyName("ignored_field_values")] + public IReadOnlyDictionary>? IgnoredFieldValues { get; init; } + [JsonInclude, JsonPropertyName("inner_hits")] + public IReadOnlyDictionary? InnerHits { get; init; } + [JsonInclude, JsonPropertyName("matched_queries")] + public IReadOnlyCollection? MatchedQueries { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public IReadOnlyCollection? Sort { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HitsMetadata.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HitsMetadata.g.cs new file mode 100644 index 00000000000..1cc0559659a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/HitsMetadata.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class HitsMetadata +{ + [JsonInclude, JsonPropertyName("hits")] + public IReadOnlyCollection> Hits { get; init; } + [JsonInclude, JsonPropertyName("max_score")] + public double? MaxScore { get; init; } + + /// + /// Total hit count information, present only if `track_total_hits` wasn't `false` in the search request. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TotalHits? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHits.g.cs new file mode 100644 index 00000000000..717eb90479a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHits.g.cs @@ -0,0 +1,900 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class InnerHits +{ + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + [JsonInclude, JsonPropertyName("collapse")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } + [JsonInclude, JsonPropertyName("docvalue_fields")] + public ICollection? DocvalueFields { get; set; } + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + + /// + /// Inner hit starting document offset. + /// + [JsonInclude, JsonPropertyName("from")] + public int? From { get; set; } + [JsonInclude, JsonPropertyName("highlight")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; } + [JsonInclude, JsonPropertyName("ignore_unmapped")] + public bool? IgnoreUnmapped { get; set; } + + /// + /// The name for the particular inner hit definition in the response.
Useful when a search request contains multiple inner hits.
+ ///
+ [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name? Name { get; set; } + [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + [JsonInclude, JsonPropertyName("seq_no_primary_term")] + public bool? SeqNoPrimaryTerm { get; set; } + + /// + /// The maximum number of hits to return per `inner_hits`. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// How the inner hits should be sorted per `inner_hits`.
By default, inner hits are sorted by score.
+ ///
+ [JsonInclude, JsonPropertyName("sort"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] + public ICollection? Sort { get; set; } + [JsonInclude, JsonPropertyName("stored_field")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredField { get; set; } + [JsonInclude, JsonPropertyName("track_scores")] + public bool? TrackScores { get; set; } + [JsonInclude, JsonPropertyName("version")] + public bool? Version { get; set; } +} + +public sealed partial class InnerHitsDescriptor : SerializableDescriptor> +{ + internal InnerHitsDescriptor(Action> configure) => configure.Invoke(this); + + public InnerHitsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private int? FromValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldValue { get; set; } + private bool? TrackScoresValue { get; set; } + private bool? VersionValue { get; set; } + + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Collapse(Action> configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Highlight(Action> configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// How the inner hits should be sorted per `inner_hits`.
By default, inner hits are sorted by score.
+ ///
+ public InnerHitsDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public InnerHitsDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + public InnerHitsDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + public InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Inner hit starting document offset. + /// + public InnerHitsDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + public InnerHitsDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// The name for the particular inner hit definition in the response.
Useful when a search request contains multiple inner hits.
+ ///
+ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + NameValue = name; + return Self; + } + + public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public InnerHitsDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The maximum number of hits to return per `inner_hits`. + /// + public InnerHitsDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Serverless.Fields? storedField) + { + StoredFieldValue = storedField; + return Self; + } + + public InnerHitsDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + public InnerHitsDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StoredFieldValue is not null) + { + writer.WritePropertyName("stored_field"); + JsonSerializer.Serialize(writer, StoredFieldValue, options); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InnerHitsDescriptor : SerializableDescriptor +{ + internal InnerHitsDescriptor(Action configure) => configure.Invoke(this); + + public InnerHitsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; } + private FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } + private HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private ICollection? SortValue { get; set; } + private SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private int? FromValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } + private IDictionary? ScriptFieldsValue { get; set; } + private bool? SeqNoPrimaryTermValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldValue { get; set; } + private bool? TrackScoresValue { get; set; } + private bool? VersionValue { get; set; } + + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) + { + CollapseDescriptor = null; + CollapseDescriptorAction = null; + CollapseValue = collapse; + return Self; + } + + public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + { + CollapseValue = null; + CollapseDescriptorAction = null; + CollapseDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Collapse(Action configure) + { + CollapseValue = null; + CollapseDescriptor = null; + CollapseDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(ICollection? docvalueFields) + { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsValue = docvalueFields; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// How the inner hits should be sorted per `inner_hits`.
By default, inner hits are sorted by score.
+ ///
+ public InnerHitsDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public InnerHitsDescriptor Sort(SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public InnerHitsDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public InnerHitsDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + return Self; + } + + public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + public InnerHitsDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + public InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Inner hit starting document offset. + /// + public InnerHitsDescriptor From(int? from) + { + FromValue = from; + return Self; + } + + public InnerHitsDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// The name for the particular inner hit definition in the response.
Useful when a search request contains multiple inner hits.
+ ///
+ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + NameValue = name; + return Self; + } + + public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public InnerHitsDescriptor SeqNoPrimaryTerm(bool? seqNoPrimaryTerm = true) + { + SeqNoPrimaryTermValue = seqNoPrimaryTerm; + return Self; + } + + /// + /// The maximum number of hits to return per `inner_hits`. + /// + public InnerHitsDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Serverless.Fields? storedField) + { + StoredFieldValue = storedField; + return Self; + } + + public InnerHitsDescriptor TrackScores(bool? trackScores = true) + { + TrackScoresValue = trackScores; + return Self; + } + + public InnerHitsDescriptor Version(bool? version = true) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CollapseDescriptor is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseDescriptor, options); + } + else if (CollapseDescriptorAction is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + } + else if (CollapseValue is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, CollapseValue, options); + } + + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + } + else if (SortDescriptorActions is not null) + { + writer.WritePropertyName("sort"); + if (SortDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in SortDescriptorActions) + { + JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (ExplainValue.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(ExplainValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (ScriptFieldsValue is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, ScriptFieldsValue, options); + } + + if (SeqNoPrimaryTermValue.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(SeqNoPrimaryTermValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (StoredFieldValue is not null) + { + writer.WritePropertyName("stored_field"); + JsonSerializer.Serialize(writer, StoredFieldValue, options); + } + + if (TrackScoresValue.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(TrackScoresValue.Value); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHitsResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHitsResult.g.cs new file mode 100644 index 00000000000..44a0a03f1b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/InnerHitsResult.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class InnerHitsResult +{ + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HitsMetadata Hits { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs new file mode 100644 index 00000000000..3a8dd69445e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs @@ -0,0 +1,61 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class LaplaceSmoothingModel +{ + [JsonInclude, JsonPropertyName("alpha")] + public double Alpha { get; set; } + + public static implicit operator SmoothingModel(LaplaceSmoothingModel laplaceSmoothingModel) => Core.Search.SmoothingModel.Laplace(laplaceSmoothingModel); +} + +public sealed partial class LaplaceSmoothingModelDescriptor : SerializableDescriptor +{ + internal LaplaceSmoothingModelDescriptor(Action configure) => configure.Invoke(this); + + public LaplaceSmoothingModelDescriptor() : base() + { + } + + private double AlphaValue { get; set; } + + public LaplaceSmoothingModelDescriptor Alpha(double alpha) + { + AlphaValue = alpha; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs new file mode 100644 index 00000000000..d9c4d69639f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class LinearInterpolationSmoothingModel +{ + [JsonInclude, JsonPropertyName("bigram_lambda")] + public double BigramLambda { get; set; } + [JsonInclude, JsonPropertyName("trigram_lambda")] + public double TrigramLambda { get; set; } + [JsonInclude, JsonPropertyName("unigram_lambda")] + public double UnigramLambda { get; set; } + + public static implicit operator SmoothingModel(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Core.Search.SmoothingModel.LinearInterpolation(linearInterpolationSmoothingModel); +} + +public sealed partial class LinearInterpolationSmoothingModelDescriptor : SerializableDescriptor +{ + internal LinearInterpolationSmoothingModelDescriptor(Action configure) => configure.Invoke(this); + + public LinearInterpolationSmoothingModelDescriptor() : base() + { + } + + private double BigramLambdaValue { get; set; } + private double TrigramLambdaValue { get; set; } + private double UnigramLambdaValue { get; set; } + + public LinearInterpolationSmoothingModelDescriptor BigramLambda(double bigramLambda) + { + BigramLambdaValue = bigramLambda; + return Self; + } + + public LinearInterpolationSmoothingModelDescriptor TrigramLambda(double trigramLambda) + { + TrigramLambdaValue = trigramLambda; + return Self; + } + + public LinearInterpolationSmoothingModelDescriptor UnigramLambda(double unigramLambda) + { + UnigramLambdaValue = unigramLambda; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bigram_lambda"); + writer.WriteNumberValue(BigramLambdaValue); + writer.WritePropertyName("trigram_lambda"); + writer.WriteNumberValue(TrigramLambdaValue); + writer.WritePropertyName("unigram_lambda"); + writer.WriteNumberValue(UnigramLambdaValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/NestedIdentity.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/NestedIdentity.g.cs new file mode 100644 index 00000000000..91caa4cf8da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/NestedIdentity.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class NestedIdentity +{ + [JsonInclude, JsonPropertyName("_nested")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.NestedIdentity? Nested { get; init; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs new file mode 100644 index 00000000000..7f177fea9e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class PhraseSuggestCollate +{ + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("prune")] + public bool? Prune { get; set; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQuery Query { get; set; } +} + +public sealed partial class PhraseSuggestCollateDescriptor : SerializableDescriptor +{ + internal PhraseSuggestCollateDescriptor(Action configure) => configure.Invoke(this); + + public PhraseSuggestCollateDescriptor() : base() + { + } + + private IDictionary? ParamsValue { get; set; } + private bool? PruneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQuery QueryValue { get; set; } + private PhraseSuggestCollateQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + public PhraseSuggestCollateDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PhraseSuggestCollateDescriptor Prune(bool? prune = true) + { + PruneValue = prune; + return Self; + } + + public PhraseSuggestCollateDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQuery query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PhraseSuggestCollateDescriptor Query(PhraseSuggestCollateQueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PhraseSuggestCollateDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (PruneValue.HasValue) + { + writer.WritePropertyName("prune"); + writer.WriteBooleanValue(PruneValue.Value); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new PhraseSuggestCollateQueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs new file mode 100644 index 00000000000..72dce3059ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class PhraseSuggestCollateQuery +{ + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } +} + +public sealed partial class PhraseSuggestCollateQueryDescriptor : SerializableDescriptor +{ + internal PhraseSuggestCollateQueryDescriptor(Action configure) => configure.Invoke(this); + + public PhraseSuggestCollateQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private string? SourceValue { get; set; } + + public PhraseSuggestCollateQueryDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + public PhraseSuggestCollateQueryDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs new file mode 100644 index 00000000000..c0c4e1e4d06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs @@ -0,0 +1,70 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class PhraseSuggestHighlight +{ + [JsonInclude, JsonPropertyName("post_tag")] + public string PostTag { get; set; } + [JsonInclude, JsonPropertyName("pre_tag")] + public string PreTag { get; set; } +} + +public sealed partial class PhraseSuggestHighlightDescriptor : SerializableDescriptor +{ + internal PhraseSuggestHighlightDescriptor(Action configure) => configure.Invoke(this); + + public PhraseSuggestHighlightDescriptor() : base() + { + } + + private string PostTagValue { get; set; } + private string PreTagValue { get; set; } + + public PhraseSuggestHighlightDescriptor PostTag(string postTag) + { + PostTagValue = postTag; + return Self; + } + + public PhraseSuggestHighlightDescriptor PreTag(string preTag) + { + PreTagValue = preTag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("post_tag"); + writer.WriteStringValue(PostTagValue); + writer.WritePropertyName("pre_tag"); + writer.WriteStringValue(PreTagValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggester.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggester.g.cs new file mode 100644 index 00000000000..2ab166ea6ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggester.g.cs @@ -0,0 +1,820 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class PhraseSuggester +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("collate")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollate? Collate { get; set; } + [JsonInclude, JsonPropertyName("confidence")] + public double? Confidence { get; set; } + [JsonInclude, JsonPropertyName("direct_generator")] + public ICollection? DirectGenerator { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("force_unigrams")] + public bool? ForceUnigrams { get; set; } + [JsonInclude, JsonPropertyName("gram_size")] + public int? GramSize { get; set; } + [JsonInclude, JsonPropertyName("highlight")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlight? Highlight { get; set; } + [JsonInclude, JsonPropertyName("max_errors")] + public double? MaxErrors { get; set; } + [JsonInclude, JsonPropertyName("real_word_error_likelihood")] + public double? RealWordErrorLikelihood { get; set; } + [JsonInclude, JsonPropertyName("separator")] + public string? Separator { get; set; } + [JsonInclude, JsonPropertyName("shard_size")] + public int? ShardSize { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + [JsonInclude, JsonPropertyName("smoothing")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel? Smoothing { get; set; } + [JsonInclude, JsonPropertyName("text")] + public string? Text { get; set; } + [JsonInclude, JsonPropertyName("token_limit")] + public int? TokenLimit { get; set; } + + public static implicit operator FieldSuggester(PhraseSuggester phraseSuggester) => Core.Search.FieldSuggester.Phrase(phraseSuggester); +} + +public sealed partial class PhraseSuggesterDescriptor : SerializableDescriptor> +{ + internal PhraseSuggesterDescriptor(Action> configure) => configure.Invoke(this); + + public PhraseSuggesterDescriptor() : base() + { + } + + private ICollection? DirectGeneratorValue { get; set; } + private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action> DirectGeneratorDescriptorAction { get; set; } + private Action>[] DirectGeneratorDescriptorActions { get; set; } + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollate? CollateValue { get; set; } + private PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } + private double? ConfidenceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? ForceUnigramsValue { get; set; } + private int? GramSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlight? HighlightValue { get; set; } + private PhraseSuggestHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private double? MaxErrorsValue { get; set; } + private double? RealWordErrorLikelihoodValue { get; set; } + private string? SeparatorValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel? SmoothingValue { get; set; } + private SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } + private string? TextValue { get; set; } + private int? TokenLimitValue { get; set; } + + public PhraseSuggesterDescriptor DirectGenerator(ICollection? directGenerator) + { + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorValue = directGenerator; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(DirectGeneratorDescriptor descriptor) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(Action> configure) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(params Action>[] configure) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = configure; + return Self; + } + + public PhraseSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollate? collate) + { + CollateDescriptor = null; + CollateDescriptorAction = null; + CollateValue = collate; + return Self; + } + + public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + { + CollateValue = null; + CollateDescriptorAction = null; + CollateDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Collate(Action configure) + { + CollateValue = null; + CollateDescriptor = null; + CollateDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor Confidence(double? confidence) + { + ConfidenceValue = confidence; + return Self; + } + + public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public PhraseSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PhraseSuggesterDescriptor ForceUnigrams(bool? forceUnigrams = true) + { + ForceUnigramsValue = forceUnigrams; + return Self; + } + + public PhraseSuggesterDescriptor GramSize(int? gramSize) + { + GramSizeValue = gramSize; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor MaxErrors(double? maxErrors) + { + MaxErrorsValue = maxErrors; + return Self; + } + + public PhraseSuggesterDescriptor RealWordErrorLikelihood(double? realWordErrorLikelihood) + { + RealWordErrorLikelihoodValue = realWordErrorLikelihood; + return Self; + } + + public PhraseSuggesterDescriptor Separator(string? separator) + { + SeparatorValue = separator; + return Self; + } + + public PhraseSuggesterDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + public PhraseSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel? smoothing) + { + SmoothingDescriptor = null; + SmoothingDescriptorAction = null; + SmoothingValue = smoothing; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + { + SmoothingValue = null; + SmoothingDescriptorAction = null; + SmoothingDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(Action configure) + { + SmoothingValue = null; + SmoothingDescriptor = null; + SmoothingDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + public PhraseSuggesterDescriptor TokenLimit(int? tokenLimit) + { + TokenLimitValue = tokenLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DirectGeneratorDescriptor is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DirectGeneratorDescriptor, options); + writer.WriteEndArray(); + } + else if (DirectGeneratorDescriptorAction is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DirectGeneratorDescriptorActions is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + foreach (var action in DirectGeneratorDescriptorActions) + { + JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DirectGeneratorValue is not null) + { + writer.WritePropertyName("direct_generator"); + JsonSerializer.Serialize(writer, DirectGeneratorValue, options); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CollateDescriptor is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, CollateDescriptor, options); + } + else if (CollateDescriptorAction is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + } + else if (CollateValue is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, CollateValue, options); + } + + if (ConfidenceValue.HasValue) + { + writer.WritePropertyName("confidence"); + writer.WriteNumberValue(ConfidenceValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (ForceUnigramsValue.HasValue) + { + writer.WritePropertyName("force_unigrams"); + writer.WriteBooleanValue(ForceUnigramsValue.Value); + } + + if (GramSizeValue.HasValue) + { + writer.WritePropertyName("gram_size"); + writer.WriteNumberValue(GramSizeValue.Value); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (MaxErrorsValue.HasValue) + { + writer.WritePropertyName("max_errors"); + writer.WriteNumberValue(MaxErrorsValue.Value); + } + + if (RealWordErrorLikelihoodValue.HasValue) + { + writer.WritePropertyName("real_word_error_likelihood"); + writer.WriteNumberValue(RealWordErrorLikelihoodValue.Value); + } + + if (!string.IsNullOrEmpty(SeparatorValue)) + { + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SmoothingDescriptor is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, SmoothingDescriptor, options); + } + else if (SmoothingDescriptorAction is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + } + else if (SmoothingValue is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, SmoothingValue, options); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + if (TokenLimitValue.HasValue) + { + writer.WritePropertyName("token_limit"); + writer.WriteNumberValue(TokenLimitValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PhraseSuggesterDescriptor : SerializableDescriptor +{ + internal PhraseSuggesterDescriptor(Action configure) => configure.Invoke(this); + + public PhraseSuggesterDescriptor() : base() + { + } + + private ICollection? DirectGeneratorValue { get; set; } + private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action DirectGeneratorDescriptorAction { get; set; } + private Action[] DirectGeneratorDescriptorActions { get; set; } + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollate? CollateValue { get; set; } + private PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } + private double? ConfidenceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? ForceUnigramsValue { get; set; } + private int? GramSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlight? HighlightValue { get; set; } + private PhraseSuggestHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private double? MaxErrorsValue { get; set; } + private double? RealWordErrorLikelihoodValue { get; set; } + private string? SeparatorValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel? SmoothingValue { get; set; } + private SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } + private string? TextValue { get; set; } + private int? TokenLimitValue { get; set; } + + public PhraseSuggesterDescriptor DirectGenerator(ICollection? directGenerator) + { + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorValue = directGenerator; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(DirectGeneratorDescriptor descriptor) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(Action configure) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorActions = null; + DirectGeneratorDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor DirectGenerator(params Action[] configure) + { + DirectGeneratorValue = null; + DirectGeneratorDescriptor = null; + DirectGeneratorDescriptorAction = null; + DirectGeneratorDescriptorActions = configure; + return Self; + } + + public PhraseSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollate? collate) + { + CollateDescriptor = null; + CollateDescriptorAction = null; + CollateValue = collate; + return Self; + } + + public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + { + CollateValue = null; + CollateDescriptorAction = null; + CollateDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Collate(Action configure) + { + CollateValue = null; + CollateDescriptor = null; + CollateDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor Confidence(double? confidence) + { + ConfidenceValue = confidence; + return Self; + } + + public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public PhraseSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PhraseSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PhraseSuggesterDescriptor ForceUnigrams(bool? forceUnigrams = true) + { + ForceUnigramsValue = forceUnigrams; + return Self; + } + + public PhraseSuggesterDescriptor GramSize(int? gramSize) + { + GramSizeValue = gramSize; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor MaxErrors(double? maxErrors) + { + MaxErrorsValue = maxErrors; + return Self; + } + + public PhraseSuggesterDescriptor RealWordErrorLikelihood(double? realWordErrorLikelihood) + { + RealWordErrorLikelihoodValue = realWordErrorLikelihood; + return Self; + } + + public PhraseSuggesterDescriptor Separator(string? separator) + { + SeparatorValue = separator; + return Self; + } + + public PhraseSuggesterDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + public PhraseSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel? smoothing) + { + SmoothingDescriptor = null; + SmoothingDescriptorAction = null; + SmoothingValue = smoothing; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + { + SmoothingValue = null; + SmoothingDescriptorAction = null; + SmoothingDescriptor = descriptor; + return Self; + } + + public PhraseSuggesterDescriptor Smoothing(Action configure) + { + SmoothingValue = null; + SmoothingDescriptor = null; + SmoothingDescriptorAction = configure; + return Self; + } + + public PhraseSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + public PhraseSuggesterDescriptor TokenLimit(int? tokenLimit) + { + TokenLimitValue = tokenLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DirectGeneratorDescriptor is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DirectGeneratorDescriptor, options); + writer.WriteEndArray(); + } + else if (DirectGeneratorDescriptorAction is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DirectGeneratorDescriptorActions is not null) + { + writer.WritePropertyName("direct_generator"); + writer.WriteStartArray(); + foreach (var action in DirectGeneratorDescriptorActions) + { + JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DirectGeneratorValue is not null) + { + writer.WritePropertyName("direct_generator"); + JsonSerializer.Serialize(writer, DirectGeneratorValue, options); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CollateDescriptor is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, CollateDescriptor, options); + } + else if (CollateDescriptorAction is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + } + else if (CollateValue is not null) + { + writer.WritePropertyName("collate"); + JsonSerializer.Serialize(writer, CollateValue, options); + } + + if (ConfidenceValue.HasValue) + { + writer.WritePropertyName("confidence"); + writer.WriteNumberValue(ConfidenceValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (ForceUnigramsValue.HasValue) + { + writer.WritePropertyName("force_unigrams"); + writer.WriteBooleanValue(ForceUnigramsValue.Value); + } + + if (GramSizeValue.HasValue) + { + writer.WritePropertyName("gram_size"); + writer.WriteNumberValue(GramSizeValue.Value); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (MaxErrorsValue.HasValue) + { + writer.WritePropertyName("max_errors"); + writer.WriteNumberValue(MaxErrorsValue.Value); + } + + if (RealWordErrorLikelihoodValue.HasValue) + { + writer.WritePropertyName("real_word_error_likelihood"); + writer.WriteNumberValue(RealWordErrorLikelihoodValue.Value); + } + + if (!string.IsNullOrEmpty(SeparatorValue)) + { + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SmoothingDescriptor is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, SmoothingDescriptor, options); + } + else if (SmoothingDescriptorAction is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + } + else if (SmoothingValue is not null) + { + writer.WritePropertyName("smoothing"); + JsonSerializer.Serialize(writer, SmoothingValue, options); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + if (TokenLimitValue.HasValue) + { + writer.WritePropertyName("token_limit"); + writer.WriteNumberValue(TokenLimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PointInTimeReference.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PointInTimeReference.g.cs new file mode 100644 index 00000000000..e3e908674ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PointInTimeReference.g.cs @@ -0,0 +1,74 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class PointInTimeReference +{ + [JsonInclude, JsonPropertyName("id")] + public string Id { get; set; } + [JsonInclude, JsonPropertyName("keep_alive")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get; set; } +} + +public sealed partial class PointInTimeReferenceDescriptor : SerializableDescriptor +{ + internal PointInTimeReferenceDescriptor(Action configure) => configure.Invoke(this); + + public PointInTimeReferenceDescriptor() : base() + { + } + + private string IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAliveValue { get; set; } + + public PointInTimeReferenceDescriptor Id(string id) + { + IdValue = id; + return Self; + } + + public PointInTimeReferenceDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) + { + KeepAliveValue = keepAlive; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(IdValue); + if (KeepAliveValue is not null) + { + writer.WritePropertyName("keep_alive"); + JsonSerializer.Serialize(writer, KeepAliveValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Profile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Profile.g.cs new file mode 100644 index 00000000000..401e400c998 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Profile.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Profile +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyCollection Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryBreakdown.g.cs new file mode 100644 index 00000000000..68c7c76cddf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryBreakdown.g.cs @@ -0,0 +1,68 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class QueryBreakdown +{ + [JsonInclude, JsonPropertyName("advance")] + public long Advance { get; init; } + [JsonInclude, JsonPropertyName("advance_count")] + public long AdvanceCount { get; init; } + [JsonInclude, JsonPropertyName("build_scorer")] + public long BuildScorer { get; init; } + [JsonInclude, JsonPropertyName("build_scorer_count")] + public long BuildScorerCount { get; init; } + [JsonInclude, JsonPropertyName("compute_max_score")] + public long ComputeMaxScore { get; init; } + [JsonInclude, JsonPropertyName("compute_max_score_count")] + public long ComputeMaxScoreCount { get; init; } + [JsonInclude, JsonPropertyName("create_weight")] + public long CreateWeight { get; init; } + [JsonInclude, JsonPropertyName("create_weight_count")] + public long CreateWeightCount { get; init; } + [JsonInclude, JsonPropertyName("match")] + public long Match { get; init; } + [JsonInclude, JsonPropertyName("match_count")] + public long MatchCount { get; init; } + [JsonInclude, JsonPropertyName("next_doc")] + public long NextDoc { get; init; } + [JsonInclude, JsonPropertyName("next_doc_count")] + public long NextDocCount { get; init; } + [JsonInclude, JsonPropertyName("score")] + public long Score { get; init; } + [JsonInclude, JsonPropertyName("score_count")] + public long ScoreCount { get; init; } + [JsonInclude, JsonPropertyName("set_min_competitive_score")] + public long SetMinCompetitiveScore { get; init; } + [JsonInclude, JsonPropertyName("set_min_competitive_score_count")] + public long SetMinCompetitiveScoreCount { get; init; } + [JsonInclude, JsonPropertyName("shallow_advance")] + public long ShallowAdvance { get; init; } + [JsonInclude, JsonPropertyName("shallow_advance_count")] + public long ShallowAdvanceCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryProfile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryProfile.g.cs new file mode 100644 index 00000000000..c26e6e606dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/QueryProfile.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class QueryProfile +{ + [JsonInclude, JsonPropertyName("breakdown")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.QueryBreakdown Breakdown { get; init; } + [JsonInclude, JsonPropertyName("children")] + public IReadOnlyCollection? Children { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("time_in_nanos")] + public long TimeInNanos { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RegexOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RegexOptions.g.cs new file mode 100644 index 00000000000..7937e4eeeea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RegexOptions.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class RegexOptions +{ + [JsonInclude, JsonPropertyName("flags")] + public Union? Flags { get; set; } + [JsonInclude, JsonPropertyName("max_determinized_states")] + public int? MaxDeterminizedStates { get; set; } +} + +public sealed partial class RegexOptionsDescriptor : SerializableDescriptor +{ + internal RegexOptionsDescriptor(Action configure) => configure.Invoke(this); + + public RegexOptionsDescriptor() : base() + { + } + + private Union? FlagsValue { get; set; } + private int? MaxDeterminizedStatesValue { get; set; } + + public RegexOptionsDescriptor Flags(Union? flags) + { + FlagsValue = flags; + return Self; + } + + public RegexOptionsDescriptor MaxDeterminizedStates(int? maxDeterminizedStates) + { + MaxDeterminizedStatesValue = maxDeterminizedStates; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FlagsValue is not null) + { + writer.WritePropertyName("flags"); + JsonSerializer.Serialize(writer, FlagsValue, options); + } + + if (MaxDeterminizedStatesValue.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(MaxDeterminizedStatesValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Rescore.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Rescore.g.cs new file mode 100644 index 00000000000..b127af33b82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Rescore.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class Rescore +{ + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQuery Query { get; set; } + [JsonInclude, JsonPropertyName("window_size")] + public int? WindowSize { get; set; } +} + +public sealed partial class RescoreDescriptor : SerializableDescriptor> +{ + internal RescoreDescriptor(Action> configure) => configure.Invoke(this); + + public RescoreDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQuery QueryValue { get; set; } + private RescoreQueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private int? WindowSizeValue { get; set; } + + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQuery query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RescoreDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public RescoreDescriptor WindowSize(int? windowSize) + { + WindowSizeValue = windowSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (WindowSizeValue.HasValue) + { + writer.WritePropertyName("window_size"); + writer.WriteNumberValue(WindowSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RescoreDescriptor : SerializableDescriptor +{ + internal RescoreDescriptor(Action configure) => configure.Invoke(this); + + public RescoreDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQuery QueryValue { get; set; } + private RescoreQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private int? WindowSizeValue { get; set; } + + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQuery query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RescoreDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public RescoreDescriptor WindowSize(int? windowSize) + { + WindowSizeValue = windowSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (WindowSizeValue.HasValue) + { + writer.WritePropertyName("window_size"); + writer.WriteNumberValue(WindowSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RescoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RescoreQuery.g.cs new file mode 100644 index 00000000000..a704ebe4129 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/RescoreQuery.g.cs @@ -0,0 +1,275 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class RescoreQuery +{ + /// + /// Relative importance of the original query versus the rescore query. + /// + [JsonInclude, JsonPropertyName("query_weight")] + public double? QueryWeight { get; set; } + + /// + /// The query to use for rescoring.
This query is only run on the Top-K results returned by the `query` and `post_filter` phases.
+ ///
+ [JsonInclude, JsonPropertyName("rescore_query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// Relative importance of the rescore query versus the original query. + /// + [JsonInclude, JsonPropertyName("rescore_query_weight")] + public double? RescoreQueryWeight { get; set; } + + /// + /// Determines how scores are combined. + /// + [JsonInclude, JsonPropertyName("score_mode")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.ScoreMode? ScoreMode { get; set; } +} + +public sealed partial class RescoreQueryDescriptor : SerializableDescriptor> +{ + internal RescoreQueryDescriptor(Action> configure) => configure.Invoke(this); + + public RescoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private double? QueryWeightValue { get; set; } + private double? RescoreQueryWeightValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.ScoreMode? ScoreModeValue { get; set; } + + /// + /// The query to use for rescoring.
This query is only run on the Top-K results returned by the `query` and `post_filter` phases.
+ ///
+ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RescoreQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Relative importance of the original query versus the rescore query. + /// + public RescoreQueryDescriptor QueryWeight(double? queryWeight) + { + QueryWeightValue = queryWeight; + return Self; + } + + /// + /// Relative importance of the rescore query versus the original query. + /// + public RescoreQueryDescriptor RescoreQueryWeight(double? rescoreQueryWeight) + { + RescoreQueryWeightValue = rescoreQueryWeight; + return Self; + } + + /// + /// Determines how scores are combined. + /// + public RescoreQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.Core.Search.ScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryWeightValue.HasValue) + { + writer.WritePropertyName("query_weight"); + writer.WriteNumberValue(QueryWeightValue.Value); + } + + if (RescoreQueryWeightValue.HasValue) + { + writer.WritePropertyName("rescore_query_weight"); + writer.WriteNumberValue(RescoreQueryWeightValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RescoreQueryDescriptor : SerializableDescriptor +{ + internal RescoreQueryDescriptor(Action configure) => configure.Invoke(this); + + public RescoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private double? QueryWeightValue { get; set; } + private double? RescoreQueryWeightValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.ScoreMode? ScoreModeValue { get; set; } + + /// + /// The query to use for rescoring.
This query is only run on the Top-K results returned by the `query` and `post_filter` phases.
+ ///
+ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RescoreQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Relative importance of the original query versus the rescore query. + /// + public RescoreQueryDescriptor QueryWeight(double? queryWeight) + { + QueryWeightValue = queryWeight; + return Self; + } + + /// + /// Relative importance of the rescore query versus the original query. + /// + public RescoreQueryDescriptor RescoreQueryWeight(double? rescoreQueryWeight) + { + RescoreQueryWeightValue = rescoreQueryWeight; + return Self; + } + + /// + /// Determines how scores are combined. + /// + public RescoreQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.Core.Search.ScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("rescore_query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryWeightValue.HasValue) + { + writer.WritePropertyName("query_weight"); + writer.WriteNumberValue(QueryWeightValue.Value); + } + + if (RescoreQueryWeightValue.HasValue) + { + writer.WritePropertyName("rescore_query_weight"); + writer.WriteNumberValue(RescoreQueryWeightValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SearchProfile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SearchProfile.g.cs new file mode 100644 index 00000000000..deca3beb491 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SearchProfile.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class SearchProfile +{ + [JsonInclude, JsonPropertyName("collector")] + public IReadOnlyCollection Collector { get; init; } + [JsonInclude, JsonPropertyName("query")] + public IReadOnlyCollection Query { get; init; } + [JsonInclude, JsonPropertyName("rewrite_time")] + public long RewriteTime { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/ShardProfile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/ShardProfile.g.cs new file mode 100644 index 00000000000..b7f93f0ad9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/ShardProfile.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class ShardProfile +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyCollection Aggregations { get; init; } + [JsonInclude, JsonPropertyName("fetch")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FetchProfile? Fetch { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("searches")] + public IReadOnlyCollection Searches { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SmoothingModel.g.cs new file mode 100644 index 00000000000..870699a31cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SmoothingModel.g.cs @@ -0,0 +1,236 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +[JsonConverter(typeof(SmoothingModelConverter))] +public sealed partial class SmoothingModel +{ + internal SmoothingModel(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static SmoothingModel Laplace(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => new SmoothingModel("laplace", laplaceSmoothingModel); + public static SmoothingModel LinearInterpolation(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => new SmoothingModel("linear_interpolation", linearInterpolationSmoothingModel); + public static SmoothingModel StupidBackoff(Elastic.Clients.Elasticsearch.Serverless.Core.Search.StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => new SmoothingModel("stupid_backoff", stupidBackoffSmoothingModel); +} + +internal sealed partial class SmoothingModelConverter : JsonConverter +{ + public override SmoothingModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "laplace") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SmoothingModel(propertyName, variant); + } + + if (propertyName == "linear_interpolation") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SmoothingModel(propertyName, variant); + } + + if (propertyName == "stupid_backoff") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SmoothingModel(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, SmoothingModel value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "laplace": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.LaplaceSmoothingModel)value.Variant, options); + break; + case "linear_interpolation": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.LinearInterpolationSmoothingModel)value.Variant, options); + break; + case "stupid_backoff": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Core.Search.StupidBackoffSmoothingModel)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SmoothingModelDescriptor : SerializableDescriptor> +{ + internal SmoothingModelDescriptor(Action> configure) => configure.Invoke(this); + + public SmoothingModelDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SmoothingModelDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SmoothingModelDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SmoothingModelDescriptor Laplace(LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => Set(stupidBackoffSmoothingModel, "stupid_backoff"); + public SmoothingModelDescriptor StupidBackoff(Action configure) => Set(configure, "stupid_backoff"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class SmoothingModelDescriptor : SerializableDescriptor +{ + internal SmoothingModelDescriptor(Action configure) => configure.Invoke(this); + + public SmoothingModelDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SmoothingModelDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SmoothingModelDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SmoothingModelDescriptor Laplace(LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => Set(stupidBackoffSmoothingModel, "stupid_backoff"); + public SmoothingModelDescriptor StupidBackoff(Action configure) => Set(configure, "stupid_backoff"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SourceFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SourceFilter.g.cs new file mode 100644 index 00000000000..c5053941ede --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SourceFilter.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +internal sealed partial class SourceFilterConverter : JsonConverter +{ + public override SourceFilter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new SourceFilter(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "excludes" || property == "exclude") + { + variant.Excludes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "includes" || property == "include") + { + variant.Includes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, SourceFilter value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Excludes is not null) + { + writer.WritePropertyName("excludes"); + JsonSerializer.Serialize(writer, value.Excludes, options); + } + + if (value.Includes is not null) + { + writer.WritePropertyName("includes"); + JsonSerializer.Serialize(writer, value.Includes, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SourceFilterConverter))] +public sealed partial class SourceFilter +{ + public Elastic.Clients.Elasticsearch.Serverless.Fields? Excludes { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Fields? Includes { get; set; } +} + +public sealed partial class SourceFilterDescriptor : SerializableDescriptor +{ + internal SourceFilterDescriptor(Action configure) => configure.Invoke(this); + + public SourceFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? ExcludesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? IncludesValue { get; set; } + + public SourceFilterDescriptor Excludes(Elastic.Clients.Elasticsearch.Serverless.Fields? excludes) + { + ExcludesValue = excludes; + return Self; + } + + public SourceFilterDescriptor Includes(Elastic.Clients.Elasticsearch.Serverless.Fields? includes) + { + IncludesValue = includes; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludesValue is not null) + { + writer.WritePropertyName("excludes"); + JsonSerializer.Serialize(writer, ExcludesValue, options); + } + + if (IncludesValue is not null) + { + writer.WritePropertyName("includes"); + JsonSerializer.Serialize(writer, IncludesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs new file mode 100644 index 00000000000..c5dbb96d453 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs @@ -0,0 +1,61 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class StupidBackoffSmoothingModel +{ + [JsonInclude, JsonPropertyName("discount")] + public double Discount { get; set; } + + public static implicit operator SmoothingModel(StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => Core.Search.SmoothingModel.StupidBackoff(stupidBackoffSmoothingModel); +} + +public sealed partial class StupidBackoffSmoothingModelDescriptor : SerializableDescriptor +{ + internal StupidBackoffSmoothingModelDescriptor(Action configure) => configure.Invoke(this); + + public StupidBackoffSmoothingModelDescriptor() : base() + { + } + + private double DiscountValue { get; set; } + + public StupidBackoffSmoothingModelDescriptor Discount(double discount) + { + DiscountValue = discount; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("discount"); + writer.WriteNumberValue(DiscountValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestFuzziness.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestFuzziness.g.cs new file mode 100644 index 00000000000..b9878dfb536 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestFuzziness.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class SuggestFuzziness +{ + [JsonInclude, JsonPropertyName("fuzziness")] + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + [JsonInclude, JsonPropertyName("min_length")] + public int? MinLength { get; set; } + [JsonInclude, JsonPropertyName("prefix_length")] + public int? PrefixLength { get; set; } + [JsonInclude, JsonPropertyName("transpositions")] + public bool? Transpositions { get; set; } + [JsonInclude, JsonPropertyName("unicode_aware")] + public bool? UnicodeAware { get; set; } +} + +public sealed partial class SuggestFuzzinessDescriptor : SerializableDescriptor +{ + internal SuggestFuzzinessDescriptor(Action configure) => configure.Invoke(this); + + public SuggestFuzzinessDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? MinLengthValue { get; set; } + private int? PrefixLengthValue { get; set; } + private bool? TranspositionsValue { get; set; } + private bool? UnicodeAwareValue { get; set; } + + public SuggestFuzzinessDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + public SuggestFuzzinessDescriptor MinLength(int? minLength) + { + MinLengthValue = minLength; + return Self; + } + + public SuggestFuzzinessDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + public SuggestFuzzinessDescriptor Transpositions(bool? transpositions = true) + { + TranspositionsValue = transpositions; + return Self; + } + + public SuggestFuzzinessDescriptor UnicodeAware(bool? unicodeAware = true) + { + UnicodeAwareValue = unicodeAware; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (MinLengthValue.HasValue) + { + writer.WritePropertyName("min_length"); + writer.WriteNumberValue(MinLengthValue.Value); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (TranspositionsValue.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(TranspositionsValue.Value); + } + + if (UnicodeAwareValue.HasValue) + { + writer.WritePropertyName("unicode_aware"); + writer.WriteBooleanValue(UnicodeAwareValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Suggester.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Suggester.g.cs new file mode 100644 index 00000000000..e9b2c95e27d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/Suggester.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +internal sealed partial class SuggesterConverter : JsonConverter +{ + public override Suggester Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new Suggester(); + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "text") + { + variant.Text = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var value = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, value); + } + } + + variant.Suggesters = additionalProperties; + return variant; + } + + public override void Write(Utf8JsonWriter writer, Suggester value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Suggesters != null) + { + foreach (var additionalProperty in value.Suggesters) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + if (!string.IsNullOrEmpty(value.Text)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(value.Text); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SuggesterConverter))] +public sealed partial class Suggester +{ + public IDictionary Suggesters { get; set; } + + /// + /// Global suggest text, to avoid repetition when the same text is used in several suggesters + /// + public string? Text { get; set; } +} + +public sealed partial class SuggesterDescriptor : SerializableDescriptor +{ + internal SuggesterDescriptor(Action configure) => configure.Invoke(this); + + public SuggesterDescriptor() : base() + { + } + + private IDictionary SuggestersValue { get; set; } + private string? TextValue { get; set; } + + public SuggesterDescriptor Suggesters(Func, FluentDictionary> selector) + { + SuggestersValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Global suggest text, to avoid repetition when the same text is used in several suggesters + /// + public SuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + if (SuggestersValue != null) + { + foreach (var additionalProperty in SuggestersValue) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggester.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggester.g.cs new file mode 100644 index 00000000000..8ed8b50eeb9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggester.g.cs @@ -0,0 +1,496 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class TermSuggester +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("lowercase_terms")] + public bool? LowercaseTerms { get; set; } + [JsonInclude, JsonPropertyName("max_edits")] + public int? MaxEdits { get; set; } + [JsonInclude, JsonPropertyName("max_inspections")] + public int? MaxInspections { get; set; } + [JsonInclude, JsonPropertyName("max_term_freq")] + public float? MaxTermFreq { get; set; } + [JsonInclude, JsonPropertyName("min_doc_freq")] + public float? MinDocFreq { get; set; } + [JsonInclude, JsonPropertyName("min_word_length")] + public int? MinWordLength { get; set; } + [JsonInclude, JsonPropertyName("prefix_length")] + public int? PrefixLength { get; set; } + [JsonInclude, JsonPropertyName("shard_size")] + public int? ShardSize { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestSort? Sort { get; set; } + [JsonInclude, JsonPropertyName("string_distance")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.StringDistance? StringDistance { get; set; } + [JsonInclude, JsonPropertyName("suggest_mode")] + public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get; set; } + [JsonInclude, JsonPropertyName("text")] + public string? Text { get; set; } + + public static implicit operator FieldSuggester(TermSuggester termSuggester) => Core.Search.FieldSuggester.Term(termSuggester); +} + +public sealed partial class TermSuggesterDescriptor : SerializableDescriptor> +{ + internal TermSuggesterDescriptor(Action> configure) => configure.Invoke(this); + + public TermSuggesterDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? LowercaseTermsValue { get; set; } + private int? MaxEditsValue { get; set; } + private int? MaxInspectionsValue { get; set; } + private float? MaxTermFreqValue { get; set; } + private float? MinDocFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private int? PrefixLengthValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestSort? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.StringDistance? StringDistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } + private string? TextValue { get; set; } + + public TermSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermSuggesterDescriptor LowercaseTerms(bool? lowercaseTerms = true) + { + LowercaseTermsValue = lowercaseTerms; + return Self; + } + + public TermSuggesterDescriptor MaxEdits(int? maxEdits) + { + MaxEditsValue = maxEdits; + return Self; + } + + public TermSuggesterDescriptor MaxInspections(int? maxInspections) + { + MaxInspectionsValue = maxInspections; + return Self; + } + + public TermSuggesterDescriptor MaxTermFreq(float? maxTermFreq) + { + MaxTermFreqValue = maxTermFreq; + return Self; + } + + public TermSuggesterDescriptor MinDocFreq(float? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + public TermSuggesterDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + public TermSuggesterDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + public TermSuggesterDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + public TermSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public TermSuggesterDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestSort? sort) + { + SortValue = sort; + return Self; + } + + public TermSuggesterDescriptor StringDistance(Elastic.Clients.Elasticsearch.Serverless.Core.Search.StringDistance? stringDistance) + { + StringDistanceValue = stringDistance; + return Self; + } + + public TermSuggesterDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) + { + SuggestModeValue = suggestMode; + return Self; + } + + public TermSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LowercaseTermsValue.HasValue) + { + writer.WritePropertyName("lowercase_terms"); + writer.WriteBooleanValue(LowercaseTermsValue.Value); + } + + if (MaxEditsValue.HasValue) + { + writer.WritePropertyName("max_edits"); + writer.WriteNumberValue(MaxEditsValue.Value); + } + + if (MaxInspectionsValue.HasValue) + { + writer.WritePropertyName("max_inspections"); + writer.WriteNumberValue(MaxInspectionsValue.Value); + } + + if (MaxTermFreqValue.HasValue) + { + writer.WritePropertyName("max_term_freq"); + writer.WriteNumberValue(MaxTermFreqValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StringDistanceValue is not null) + { + writer.WritePropertyName("string_distance"); + JsonSerializer.Serialize(writer, StringDistanceValue, options); + } + + if (SuggestModeValue is not null) + { + writer.WritePropertyName("suggest_mode"); + JsonSerializer.Serialize(writer, SuggestModeValue, options); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TermSuggesterDescriptor : SerializableDescriptor +{ + internal TermSuggesterDescriptor(Action configure) => configure.Invoke(this); + + public TermSuggesterDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? LowercaseTermsValue { get; set; } + private int? MaxEditsValue { get; set; } + private int? MaxInspectionsValue { get; set; } + private float? MaxTermFreqValue { get; set; } + private float? MinDocFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private int? PrefixLengthValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestSort? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.StringDistance? StringDistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } + private string? TextValue { get; set; } + + public TermSuggesterDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermSuggesterDescriptor LowercaseTerms(bool? lowercaseTerms = true) + { + LowercaseTermsValue = lowercaseTerms; + return Self; + } + + public TermSuggesterDescriptor MaxEdits(int? maxEdits) + { + MaxEditsValue = maxEdits; + return Self; + } + + public TermSuggesterDescriptor MaxInspections(int? maxInspections) + { + MaxInspectionsValue = maxInspections; + return Self; + } + + public TermSuggesterDescriptor MaxTermFreq(float? maxTermFreq) + { + MaxTermFreqValue = maxTermFreq; + return Self; + } + + public TermSuggesterDescriptor MinDocFreq(float? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + public TermSuggesterDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + public TermSuggesterDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + public TermSuggesterDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + public TermSuggesterDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + public TermSuggesterDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestSort? sort) + { + SortValue = sort; + return Self; + } + + public TermSuggesterDescriptor StringDistance(Elastic.Clients.Elasticsearch.Serverless.Core.Search.StringDistance? stringDistance) + { + StringDistanceValue = stringDistance; + return Self; + } + + public TermSuggesterDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) + { + SuggestModeValue = suggestMode; + return Self; + } + + public TermSuggesterDescriptor Text(string? text) + { + TextValue = text; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LowercaseTermsValue.HasValue) + { + writer.WritePropertyName("lowercase_terms"); + writer.WriteBooleanValue(LowercaseTermsValue.Value); + } + + if (MaxEditsValue.HasValue) + { + writer.WritePropertyName("max_edits"); + writer.WriteNumberValue(MaxEditsValue.Value); + } + + if (MaxInspectionsValue.HasValue) + { + writer.WritePropertyName("max_inspections"); + writer.WriteNumberValue(MaxInspectionsValue.Value); + } + + if (MaxTermFreqValue.HasValue) + { + writer.WritePropertyName("max_term_freq"); + writer.WriteNumberValue(MaxTermFreqValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (ShardSizeValue.HasValue) + { + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StringDistanceValue is not null) + { + writer.WritePropertyName("string_distance"); + JsonSerializer.Serialize(writer, StringDistanceValue, options); + } + + if (SuggestModeValue is not null) + { + writer.WritePropertyName("suggest_mode"); + JsonSerializer.Serialize(writer, SuggestModeValue, options); + } + + if (!string.IsNullOrEmpty(TextValue)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(TextValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TotalHits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TotalHits.g.cs new file mode 100644 index 00000000000..38d3ab3e4a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TotalHits.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class TotalHits +{ + [JsonInclude, JsonPropertyName("relation")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TotalHitsRelation Relation { get; init; } + [JsonInclude, JsonPropertyName("value")] + public long Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs new file mode 100644 index 00000000000..eca42399445 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class SourceConfig : Union +{ + public SourceConfig(bool fetch) : base(fetch) + { + } + + public SourceConfig(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceFilter filter) : base(filter) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs new file mode 100644 index 00000000000..8268e256859 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class SourceConfigParam : Union +{ + public SourceConfigParam(bool fetch) : base(fetch) + { + } + + public SourceConfigParam(Elastic.Clients.Elasticsearch.Serverless.Fields fields) : base(fields) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs new file mode 100644 index 00000000000..a8b2719db6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors; + +public sealed partial class FieldStatistics +{ + [JsonInclude, JsonPropertyName("doc_count")] + public int DocCount { get; init; } + [JsonInclude, JsonPropertyName("sum_doc_freq")] + public long SumDocFreq { get; init; } + [JsonInclude, JsonPropertyName("sum_ttf")] + public long SumTtf { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Filter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Filter.g.cs new file mode 100644 index 00000000000..3be5168e0a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Filter.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors; + +public sealed partial class Filter +{ + [JsonInclude, JsonPropertyName("max_doc_freq")] + public int? MaxDocFreq { get; set; } + [JsonInclude, JsonPropertyName("max_num_terms")] + public int? MaxNumTerms { get; set; } + [JsonInclude, JsonPropertyName("max_term_freq")] + public int? MaxTermFreq { get; set; } + [JsonInclude, JsonPropertyName("max_word_length")] + public int? MaxWordLength { get; set; } + [JsonInclude, JsonPropertyName("min_doc_freq")] + public int? MinDocFreq { get; set; } + [JsonInclude, JsonPropertyName("min_term_freq")] + public int? MinTermFreq { get; set; } + [JsonInclude, JsonPropertyName("min_word_length")] + public int? MinWordLength { get; set; } +} + +public sealed partial class FilterDescriptor : SerializableDescriptor +{ + internal FilterDescriptor(Action configure) => configure.Invoke(this); + + public FilterDescriptor() : base() + { + } + + private int? MaxDocFreqValue { get; set; } + private int? MaxNumTermsValue { get; set; } + private int? MaxTermFreqValue { get; set; } + private int? MaxWordLengthValue { get; set; } + private int? MinDocFreqValue { get; set; } + private int? MinTermFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + + public FilterDescriptor MaxDocFreq(int? maxDocFreq) + { + MaxDocFreqValue = maxDocFreq; + return Self; + } + + public FilterDescriptor MaxNumTerms(int? maxNumTerms) + { + MaxNumTermsValue = maxNumTerms; + return Self; + } + + public FilterDescriptor MaxTermFreq(int? maxTermFreq) + { + MaxTermFreqValue = maxTermFreq; + return Self; + } + + public FilterDescriptor MaxWordLength(int? maxWordLength) + { + MaxWordLengthValue = maxWordLength; + return Self; + } + + public FilterDescriptor MinDocFreq(int? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + public FilterDescriptor MinTermFreq(int? minTermFreq) + { + MinTermFreqValue = minTermFreq; + return Self; + } + + public FilterDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxDocFreqValue.HasValue) + { + writer.WritePropertyName("max_doc_freq"); + writer.WriteNumberValue(MaxDocFreqValue.Value); + } + + if (MaxNumTermsValue.HasValue) + { + writer.WritePropertyName("max_num_terms"); + writer.WriteNumberValue(MaxNumTermsValue.Value); + } + + if (MaxTermFreqValue.HasValue) + { + writer.WritePropertyName("max_term_freq"); + writer.WriteNumberValue(MaxTermFreqValue.Value); + } + + if (MaxWordLengthValue.HasValue) + { + writer.WritePropertyName("max_word_length"); + writer.WriteNumberValue(MaxWordLengthValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinTermFreqValue.HasValue) + { + writer.WritePropertyName("min_term_freq"); + writer.WriteNumberValue(MinTermFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Term.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Term.g.cs new file mode 100644 index 00000000000..9c60187ed6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Term.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors; + +public sealed partial class Term +{ + [JsonInclude, JsonPropertyName("doc_freq")] + public int? DocFreq { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double? Score { get; init; } + [JsonInclude, JsonPropertyName("term_freq")] + public int TermFreq { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection? Tokens { get; init; } + [JsonInclude, JsonPropertyName("ttf")] + public int? Ttf { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/TermVector.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/TermVector.g.cs new file mode 100644 index 00000000000..5348a67388a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/TermVector.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors; + +public sealed partial class TermVector +{ + [JsonInclude, JsonPropertyName("field_statistics")] + public Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FieldStatistics FieldStatistics { get; init; } + [JsonInclude, JsonPropertyName("terms")] + public IReadOnlyDictionary Terms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Token.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Token.g.cs new file mode 100644 index 00000000000..fdcff79c408 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TermVectors/Token.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors; + +public sealed partial class Token +{ + [JsonInclude, JsonPropertyName("end_offset")] + public int? EndOffset { get; init; } + [JsonInclude, JsonPropertyName("payload")] + public string? Payload { get; init; } + [JsonInclude, JsonPropertyName("position")] + public int Position { get; init; } + [JsonInclude, JsonPropertyName("start_offset")] + public int? StartOffset { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs new file mode 100644 index 00000000000..4cd105b3020 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public sealed partial class TrackHits : Union +{ + public TrackHits(bool enabled) : base(enabled) + { + } + + public TrackHits(int count) : base(count) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/DocStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/DocStats.g.cs new file mode 100644 index 00000000000..b500b748eba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/DocStats.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class DocStats +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("deleted")] + public long? Deleted { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ElasticsearchVersionInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ElasticsearchVersionInfo.g.cs new file mode 100644 index 00000000000..c596d5737c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ElasticsearchVersionInfo.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ElasticsearchVersionInfo +{ + [JsonInclude, JsonPropertyName("build_date")] + public DateTimeOffset BuildDate { get; init; } + [JsonInclude, JsonPropertyName("build_flavor")] + public string BuildFlavor { get; init; } + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { get; init; } + [JsonInclude, JsonPropertyName("build_snapshot")] + public bool BuildSnapshot { get; init; } + [JsonInclude, JsonPropertyName("build_type")] + public string BuildType { get; init; } + [JsonInclude, JsonPropertyName("lucene_version")] + public string LuceneVersion { get; init; } + [JsonInclude, JsonPropertyName("minimum_index_compatibility_version")] + public string MinimumIndexCompatibilityVersion { get; init; } + [JsonInclude, JsonPropertyName("minimum_wire_compatibility_version")] + public string MinimumWireCompatibilityVersion { get; init; } + [JsonInclude, JsonPropertyName("number")] + public string Number { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs new file mode 100644 index 00000000000..c5e7169a508 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// For empty Class assignments +/// +public sealed partial class EmptyObject +{ +} + +/// +/// For empty Class assignments +/// +public sealed partial class EmptyObjectDescriptor : SerializableDescriptor +{ + internal EmptyObjectDescriptor(Action configure) => configure.Invoke(this); + + public EmptyObjectDescriptor() : base() + { + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CacheStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CacheStats.g.cs new file mode 100644 index 00000000000..bd7b388718d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CacheStats.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class CacheStats +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("evictions")] + public int Evictions { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public int Hits { get; init; } + [JsonInclude, JsonPropertyName("misses")] + public int Misses { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CoordinatorStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CoordinatorStats.g.cs new file mode 100644 index 00000000000..5c7cbf47fe9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/CoordinatorStats.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class CoordinatorStats +{ + [JsonInclude, JsonPropertyName("executed_searches_total")] + public long ExecutedSearchesTotal { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } + [JsonInclude, JsonPropertyName("queue_size")] + public int QueueSize { get; init; } + [JsonInclude, JsonPropertyName("remote_requests_current")] + public int RemoteRequestsCurrent { get; init; } + [JsonInclude, JsonPropertyName("remote_requests_total")] + public long RemoteRequestsTotal { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs new file mode 100644 index 00000000000..28e69e434fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs @@ -0,0 +1,226 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class EnrichPolicy +{ + [JsonInclude, JsonPropertyName("elasticsearch_version")] + public string? ElasticsearchVersion { get; set; } + [JsonInclude, JsonPropertyName("enrich_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields EnrichFields { get; set; } + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices Indices { get; set; } + [JsonInclude, JsonPropertyName("match_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field MatchField { get; set; } + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name? Name { get; set; } + [JsonInclude, JsonPropertyName("query")] + public string? Query { get; set; } +} + +public sealed partial class EnrichPolicyDescriptor : SerializableDescriptor> +{ + internal EnrichPolicyDescriptor(Action> configure) => configure.Invoke(this); + + public EnrichPolicyDescriptor() : base() + { + } + + private string? ElasticsearchVersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields EnrichFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field MatchFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } + private string? QueryValue { get; set; } + + public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) + { + ElasticsearchVersionValue = elasticsearchVersion; + return Self; + } + + public EnrichPolicyDescriptor EnrichFields(Elastic.Clients.Elasticsearch.Serverless.Fields enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public EnrichPolicyDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + public EnrichPolicyDescriptor MatchField(Elastic.Clients.Elasticsearch.Serverless.Field matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public EnrichPolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public EnrichPolicyDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + NameValue = name; + return Self; + } + + public EnrichPolicyDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ElasticsearchVersionValue)) + { + writer.WritePropertyName("elasticsearch_version"); + writer.WriteStringValue(ElasticsearchVersionValue); + } + + writer.WritePropertyName("enrich_fields"); + JsonSerializer.Serialize(writer, EnrichFieldsValue, options); + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + writer.WritePropertyName("match_field"); + JsonSerializer.Serialize(writer, MatchFieldValue, options); + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class EnrichPolicyDescriptor : SerializableDescriptor +{ + internal EnrichPolicyDescriptor(Action configure) => configure.Invoke(this); + + public EnrichPolicyDescriptor() : base() + { + } + + private string? ElasticsearchVersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields EnrichFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field MatchFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } + private string? QueryValue { get; set; } + + public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) + { + ElasticsearchVersionValue = elasticsearchVersion; + return Self; + } + + public EnrichPolicyDescriptor EnrichFields(Elastic.Clients.Elasticsearch.Serverless.Fields enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public EnrichPolicyDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + public EnrichPolicyDescriptor MatchField(Elastic.Clients.Elasticsearch.Serverless.Field matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public EnrichPolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public EnrichPolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public EnrichPolicyDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + NameValue = name; + return Self; + } + + public EnrichPolicyDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ElasticsearchVersionValue)) + { + writer.WritePropertyName("elasticsearch_version"); + writer.WriteStringValue(ElasticsearchVersionValue); + } + + writer.WritePropertyName("enrich_fields"); + JsonSerializer.Serialize(writer, EnrichFieldsValue, options); + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + writer.WritePropertyName("match_field"); + JsonSerializer.Serialize(writer, MatchFieldValue, options); + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs new file mode 100644 index 00000000000..2c54b1e3465 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class EnrichSummary +{ + [JsonInclude, JsonPropertyName("config")] + public KeyValuePair Config { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs new file mode 100644 index 00000000000..9f956d48fd5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class ExecuteEnrichPolicyStatus +{ + [JsonInclude, JsonPropertyName("phase")] + public Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyPhase Phase { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecutingPolicy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecutingPolicy.g.cs new file mode 100644 index 00000000000..84cfab7076b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/ExecutingPolicy.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +public sealed partial class ExecutingPolicy +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("task")] + public Elastic.Clients.Elasticsearch.Serverless.Tasks.TaskInfo Task { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Aggregations.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Aggregations.g.cs new file mode 100644 index 00000000000..fda52cbf16e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Aggregations.g.cs @@ -0,0 +1,731 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; + +[JsonConverter(typeof(CalendarIntervalConverter))] +public enum CalendarInterval +{ + [EnumMember(Value = "year")] + Year, + [EnumMember(Value = "week")] + Week, + [EnumMember(Value = "second")] + Second, + [EnumMember(Value = "quarter")] + Quarter, + [EnumMember(Value = "month")] + Month, + [EnumMember(Value = "minute")] + Minute, + [EnumMember(Value = "hour")] + Hour, + [EnumMember(Value = "day")] + Day +} + +internal sealed class CalendarIntervalConverter : JsonConverter +{ + public override CalendarInterval Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "year": + case "1Y": + return CalendarInterval.Year; + case "week": + case "1w": + return CalendarInterval.Week; + case "second": + case "1s": + return CalendarInterval.Second; + case "quarter": + case "1q": + return CalendarInterval.Quarter; + case "month": + case "1M": + return CalendarInterval.Month; + case "minute": + case "1m": + return CalendarInterval.Minute; + case "hour": + case "1h": + return CalendarInterval.Hour; + case "day": + case "1d": + return CalendarInterval.Day; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, CalendarInterval value, JsonSerializerOptions options) + { + switch (value) + { + case CalendarInterval.Year: + writer.WriteStringValue("year"); + return; + case CalendarInterval.Week: + writer.WriteStringValue("week"); + return; + case CalendarInterval.Second: + writer.WriteStringValue("second"); + return; + case CalendarInterval.Quarter: + writer.WriteStringValue("quarter"); + return; + case CalendarInterval.Month: + writer.WriteStringValue("month"); + return; + case CalendarInterval.Minute: + writer.WriteStringValue("minute"); + return; + case CalendarInterval.Hour: + writer.WriteStringValue("hour"); + return; + case CalendarInterval.Day: + writer.WriteStringValue("day"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(CardinalityExecutionModeConverter))] +public enum CardinalityExecutionMode +{ + /// + /// Run the aggregation by using segment ordinal values and resolving those values after each segment. + /// + [EnumMember(Value = "segment_ordinals")] + SegmentOrdinals, + /// + /// Heuristic-based mode, default in Elasticsearch 8.4 and later. + /// + [EnumMember(Value = "save_time_heuristic")] + SaveTimeHeuristic, + /// + /// Heuristic-based mode, default in Elasticsearch 8.3 and earlier. + /// + [EnumMember(Value = "save_memory_heuristic")] + SaveMemoryHeuristic, + /// + /// Run the aggregation by using global ordinals of the field and resolving those values after finishing a shard. + /// + [EnumMember(Value = "global_ordinals")] + GlobalOrdinals, + /// + /// Run the aggregation by using field values directly. + /// + [EnumMember(Value = "direct")] + Direct +} + +internal sealed class CardinalityExecutionModeConverter : JsonConverter +{ + public override CardinalityExecutionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "segment_ordinals": + return CardinalityExecutionMode.SegmentOrdinals; + case "save_time_heuristic": + return CardinalityExecutionMode.SaveTimeHeuristic; + case "save_memory_heuristic": + return CardinalityExecutionMode.SaveMemoryHeuristic; + case "global_ordinals": + return CardinalityExecutionMode.GlobalOrdinals; + case "direct": + return CardinalityExecutionMode.Direct; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, CardinalityExecutionMode value, JsonSerializerOptions options) + { + switch (value) + { + case CardinalityExecutionMode.SegmentOrdinals: + writer.WriteStringValue("segment_ordinals"); + return; + case CardinalityExecutionMode.SaveTimeHeuristic: + writer.WriteStringValue("save_time_heuristic"); + return; + case CardinalityExecutionMode.SaveMemoryHeuristic: + writer.WriteStringValue("save_memory_heuristic"); + return; + case CardinalityExecutionMode.GlobalOrdinals: + writer.WriteStringValue("global_ordinals"); + return; + case CardinalityExecutionMode.Direct: + writer.WriteStringValue("direct"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GapPolicyConverter))] +public enum GapPolicy +{ + /// + /// Treats missing data as if the bucket does not exist. It will skip the bucket and
continue calculating using the next available value.
+ ///
+ [EnumMember(Value = "skip")] + Skip, + /// + /// Similar to skip, except if the metric provides a non-null, non-NaN value this value is used,
otherwise the empty bucket is skipped.
+ ///
+ [EnumMember(Value = "keep_values")] + KeepValues, + /// + /// Replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal. + /// + [EnumMember(Value = "insert_zeros")] + InsertZeros +} + +internal sealed class GapPolicyConverter : JsonConverter +{ + public override GapPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "skip": + return GapPolicy.Skip; + case "keep_values": + return GapPolicy.KeepValues; + case "insert_zeros": + return GapPolicy.InsertZeros; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GapPolicy value, JsonSerializerOptions options) + { + switch (value) + { + case GapPolicy.Skip: + writer.WriteStringValue("skip"); + return; + case GapPolicy.KeepValues: + writer.WriteStringValue("keep_values"); + return; + case GapPolicy.InsertZeros: + writer.WriteStringValue("insert_zeros"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MinimumIntervalConverter))] +public enum MinimumInterval +{ + [EnumMember(Value = "year")] + Year, + [EnumMember(Value = "second")] + Second, + [EnumMember(Value = "month")] + Month, + [EnumMember(Value = "minute")] + Minute, + [EnumMember(Value = "hour")] + Hour, + [EnumMember(Value = "day")] + Day +} + +internal sealed class MinimumIntervalConverter : JsonConverter +{ + public override MinimumInterval Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "year": + return MinimumInterval.Year; + case "second": + return MinimumInterval.Second; + case "month": + return MinimumInterval.Month; + case "minute": + return MinimumInterval.Minute; + case "hour": + return MinimumInterval.Hour; + case "day": + return MinimumInterval.Day; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, MinimumInterval value, JsonSerializerOptions options) + { + switch (value) + { + case MinimumInterval.Year: + writer.WriteStringValue("year"); + return; + case MinimumInterval.Second: + writer.WriteStringValue("second"); + return; + case MinimumInterval.Month: + writer.WriteStringValue("month"); + return; + case MinimumInterval.Minute: + writer.WriteStringValue("minute"); + return; + case MinimumInterval.Hour: + writer.WriteStringValue("hour"); + return; + case MinimumInterval.Day: + writer.WriteStringValue("day"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MissingOrderConverter))] +public enum MissingOrder +{ + [EnumMember(Value = "last")] + Last, + [EnumMember(Value = "first")] + First, + [EnumMember(Value = "default")] + Default +} + +internal sealed class MissingOrderConverter : JsonConverter +{ + public override MissingOrder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "last": + return MissingOrder.Last; + case "first": + return MissingOrder.First; + case "default": + return MissingOrder.Default; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, MissingOrder value, JsonSerializerOptions options) + { + switch (value) + { + case MissingOrder.Last: + writer.WriteStringValue("last"); + return; + case MissingOrder.First: + writer.WriteStringValue("first"); + return; + case MissingOrder.Default: + writer.WriteStringValue("default"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RateModeConverter))] +public enum RateMode +{ + /// + /// Uses the number of values of the field. + /// + [EnumMember(Value = "value_count")] + ValueCount, + /// + /// Calculates the sum of all values of the field. + /// + [EnumMember(Value = "sum")] + Sum +} + +internal sealed class RateModeConverter : JsonConverter +{ + public override RateMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "value_count": + return RateMode.ValueCount; + case "sum": + return RateMode.Sum; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, RateMode value, JsonSerializerOptions options) + { + switch (value) + { + case RateMode.ValueCount: + writer.WriteStringValue("value_count"); + return; + case RateMode.Sum: + writer.WriteStringValue("sum"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SamplerAggregationExecutionHintConverter))] +public enum SamplerAggregationExecutionHint +{ + /// + /// Hold field values directly. + /// + [EnumMember(Value = "map")] + Map, + /// + /// Hold ordinals of the field as determined by the Lucene index. + /// + [EnumMember(Value = "global_ordinals")] + GlobalOrdinals, + /// + /// Hold hashes of the field values - with potential for hash collisions. + /// + [EnumMember(Value = "bytes_hash")] + BytesHash +} + +internal sealed class SamplerAggregationExecutionHintConverter : JsonConverter +{ + public override SamplerAggregationExecutionHint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "map": + return SamplerAggregationExecutionHint.Map; + case "global_ordinals": + return SamplerAggregationExecutionHint.GlobalOrdinals; + case "bytes_hash": + return SamplerAggregationExecutionHint.BytesHash; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SamplerAggregationExecutionHint value, JsonSerializerOptions options) + { + switch (value) + { + case SamplerAggregationExecutionHint.Map: + writer.WriteStringValue("map"); + return; + case SamplerAggregationExecutionHint.GlobalOrdinals: + writer.WriteStringValue("global_ordinals"); + return; + case SamplerAggregationExecutionHint.BytesHash: + writer.WriteStringValue("bytes_hash"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TermsAggregationCollectModeConverter))] +public enum TermsAggregationCollectMode +{ + /// + /// Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs. + /// + [EnumMember(Value = "depth_first")] + DepthFirst, + /// + /// Caches the set of documents that fall into the uppermost buckets for subsequent replay. + /// + [EnumMember(Value = "breadth_first")] + BreadthFirst +} + +internal sealed class TermsAggregationCollectModeConverter : JsonConverter +{ + public override TermsAggregationCollectMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "depth_first": + return TermsAggregationCollectMode.DepthFirst; + case "breadth_first": + return TermsAggregationCollectMode.BreadthFirst; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TermsAggregationCollectMode value, JsonSerializerOptions options) + { + switch (value) + { + case TermsAggregationCollectMode.DepthFirst: + writer.WriteStringValue("depth_first"); + return; + case TermsAggregationCollectMode.BreadthFirst: + writer.WriteStringValue("breadth_first"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TermsAggregationExecutionHintConverter))] +public enum TermsAggregationExecutionHint +{ + [EnumMember(Value = "map")] + Map, + [EnumMember(Value = "global_ordinals_low_cardinality")] + GlobalOrdinalsLowCardinality, + [EnumMember(Value = "global_ordinals_hash")] + GlobalOrdinalsHash, + [EnumMember(Value = "global_ordinals")] + GlobalOrdinals +} + +internal sealed class TermsAggregationExecutionHintConverter : JsonConverter +{ + public override TermsAggregationExecutionHint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "map": + return TermsAggregationExecutionHint.Map; + case "global_ordinals_low_cardinality": + return TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality; + case "global_ordinals_hash": + return TermsAggregationExecutionHint.GlobalOrdinalsHash; + case "global_ordinals": + return TermsAggregationExecutionHint.GlobalOrdinals; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TermsAggregationExecutionHint value, JsonSerializerOptions options) + { + switch (value) + { + case TermsAggregationExecutionHint.Map: + writer.WriteStringValue("map"); + return; + case TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality: + writer.WriteStringValue("global_ordinals_low_cardinality"); + return; + case TermsAggregationExecutionHint.GlobalOrdinalsHash: + writer.WriteStringValue("global_ordinals_hash"); + return; + case TermsAggregationExecutionHint.GlobalOrdinals: + writer.WriteStringValue("global_ordinals"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TTestTypeConverter))] +public enum TTestType +{ + /// + /// Performs paired t-test. + /// + [EnumMember(Value = "paired")] + Paired, + /// + /// Performs two-sample equal variance test. + /// + [EnumMember(Value = "homoscedastic")] + Homoscedastic, + /// + /// Performs two-sample unequal variance test. + /// + [EnumMember(Value = "heteroscedastic")] + Heteroscedastic +} + +internal sealed class TTestTypeConverter : JsonConverter +{ + public override TTestType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "paired": + return TTestType.Paired; + case "homoscedastic": + return TTestType.Homoscedastic; + case "heteroscedastic": + return TTestType.Heteroscedastic; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TTestType value, JsonSerializerOptions options) + { + switch (value) + { + case TTestType.Paired: + writer.WriteStringValue("paired"); + return; + case TTestType.Homoscedastic: + writer.WriteStringValue("homoscedastic"); + return; + case TTestType.Heteroscedastic: + writer.WriteStringValue("heteroscedastic"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ValueTypeConverter))] +public enum ValueType +{ + [EnumMember(Value = "string")] + String, + [EnumMember(Value = "numeric")] + Numeric, + [EnumMember(Value = "number")] + Number, + [EnumMember(Value = "long")] + Long, + [EnumMember(Value = "ip")] + Ip, + [EnumMember(Value = "geo_point")] + GeoPoint, + [EnumMember(Value = "double")] + Double, + [EnumMember(Value = "date_nanos")] + DateNanos, + [EnumMember(Value = "date")] + Date, + [EnumMember(Value = "boolean")] + Boolean +} + +internal sealed class ValueTypeConverter : JsonConverter +{ + public override ValueType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "string": + return ValueType.String; + case "numeric": + return ValueType.Numeric; + case "number": + return ValueType.Number; + case "long": + return ValueType.Long; + case "ip": + return ValueType.Ip; + case "geo_point": + return ValueType.GeoPoint; + case "double": + return ValueType.Double; + case "date_nanos": + return ValueType.DateNanos; + case "date": + return ValueType.Date; + case "boolean": + return ValueType.Boolean; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ValueType value, JsonSerializerOptions options) + { + switch (value) + { + case ValueType.String: + writer.WriteStringValue("string"); + return; + case ValueType.Numeric: + writer.WriteStringValue("numeric"); + return; + case ValueType.Number: + writer.WriteStringValue("number"); + return; + case ValueType.Long: + writer.WriteStringValue("long"); + return; + case ValueType.Ip: + writer.WriteStringValue("ip"); + return; + case ValueType.GeoPoint: + writer.WriteStringValue("geo_point"); + return; + case ValueType.Double: + writer.WriteStringValue("double"); + return; + case ValueType.DateNanos: + writer.WriteStringValue("date_nanos"); + return; + case ValueType.Date: + writer.WriteStringValue("date"); + return; + case ValueType.Boolean: + writer.WriteStringValue("boolean"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Analysis.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Analysis.g.cs new file mode 100644 index 00000000000..4caf9c3e0d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Analysis.g.cs @@ -0,0 +1,1437 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; + +[JsonConverter(typeof(DelimitedPayloadEncodingConverter))] +public enum DelimitedPayloadEncoding +{ + [EnumMember(Value = "int")] + Integer, + [EnumMember(Value = "identity")] + Identity, + [EnumMember(Value = "float")] + Float +} + +internal sealed class DelimitedPayloadEncodingConverter : JsonConverter +{ + public override DelimitedPayloadEncoding Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "int": + return DelimitedPayloadEncoding.Integer; + case "identity": + return DelimitedPayloadEncoding.Identity; + case "float": + return DelimitedPayloadEncoding.Float; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DelimitedPayloadEncoding value, JsonSerializerOptions options) + { + switch (value) + { + case DelimitedPayloadEncoding.Integer: + writer.WriteStringValue("int"); + return; + case DelimitedPayloadEncoding.Identity: + writer.WriteStringValue("identity"); + return; + case DelimitedPayloadEncoding.Float: + writer.WriteStringValue("float"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(EdgeNGramSideConverter))] +public enum EdgeNGramSide +{ + [EnumMember(Value = "front")] + Front, + [EnumMember(Value = "back")] + Back +} + +internal sealed class EdgeNGramSideConverter : JsonConverter +{ + public override EdgeNGramSide Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "front": + return EdgeNGramSide.Front; + case "back": + return EdgeNGramSide.Back; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, EdgeNGramSide value, JsonSerializerOptions options) + { + switch (value) + { + case EdgeNGramSide.Front: + writer.WriteStringValue("front"); + return; + case EdgeNGramSide.Back: + writer.WriteStringValue("back"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuCollationAlternateConverter))] +public enum IcuCollationAlternate +{ + [EnumMember(Value = "shifted")] + Shifted, + [EnumMember(Value = "non-ignorable")] + NonIgnorable +} + +internal sealed class IcuCollationAlternateConverter : JsonConverter +{ + public override IcuCollationAlternate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "shifted": + return IcuCollationAlternate.Shifted; + case "non-ignorable": + return IcuCollationAlternate.NonIgnorable; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuCollationAlternate value, JsonSerializerOptions options) + { + switch (value) + { + case IcuCollationAlternate.Shifted: + writer.WriteStringValue("shifted"); + return; + case IcuCollationAlternate.NonIgnorable: + writer.WriteStringValue("non-ignorable"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuCollationCaseFirstConverter))] +public enum IcuCollationCaseFirst +{ + [EnumMember(Value = "upper")] + Upper, + [EnumMember(Value = "lower")] + Lower +} + +internal sealed class IcuCollationCaseFirstConverter : JsonConverter +{ + public override IcuCollationCaseFirst Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "upper": + return IcuCollationCaseFirst.Upper; + case "lower": + return IcuCollationCaseFirst.Lower; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuCollationCaseFirst value, JsonSerializerOptions options) + { + switch (value) + { + case IcuCollationCaseFirst.Upper: + writer.WriteStringValue("upper"); + return; + case IcuCollationCaseFirst.Lower: + writer.WriteStringValue("lower"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuCollationDecompositionConverter))] +public enum IcuCollationDecomposition +{ + [EnumMember(Value = "no")] + No, + [EnumMember(Value = "identical")] + Identical +} + +internal sealed class IcuCollationDecompositionConverter : JsonConverter +{ + public override IcuCollationDecomposition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "no": + return IcuCollationDecomposition.No; + case "identical": + return IcuCollationDecomposition.Identical; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuCollationDecomposition value, JsonSerializerOptions options) + { + switch (value) + { + case IcuCollationDecomposition.No: + writer.WriteStringValue("no"); + return; + case IcuCollationDecomposition.Identical: + writer.WriteStringValue("identical"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuCollationStrengthConverter))] +public enum IcuCollationStrength +{ + [EnumMember(Value = "tertiary")] + Tertiary, + [EnumMember(Value = "secondary")] + Secondary, + [EnumMember(Value = "quaternary")] + Quaternary, + [EnumMember(Value = "primary")] + Primary, + [EnumMember(Value = "identical")] + Identical +} + +internal sealed class IcuCollationStrengthConverter : JsonConverter +{ + public override IcuCollationStrength Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "tertiary": + return IcuCollationStrength.Tertiary; + case "secondary": + return IcuCollationStrength.Secondary; + case "quaternary": + return IcuCollationStrength.Quaternary; + case "primary": + return IcuCollationStrength.Primary; + case "identical": + return IcuCollationStrength.Identical; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuCollationStrength value, JsonSerializerOptions options) + { + switch (value) + { + case IcuCollationStrength.Tertiary: + writer.WriteStringValue("tertiary"); + return; + case IcuCollationStrength.Secondary: + writer.WriteStringValue("secondary"); + return; + case IcuCollationStrength.Quaternary: + writer.WriteStringValue("quaternary"); + return; + case IcuCollationStrength.Primary: + writer.WriteStringValue("primary"); + return; + case IcuCollationStrength.Identical: + writer.WriteStringValue("identical"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuNormalizationModeConverter))] +public enum IcuNormalizationMode +{ + [EnumMember(Value = "decompose")] + Decompose, + [EnumMember(Value = "compose")] + Compose +} + +internal sealed class IcuNormalizationModeConverter : JsonConverter +{ + public override IcuNormalizationMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "decompose": + return IcuNormalizationMode.Decompose; + case "compose": + return IcuNormalizationMode.Compose; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuNormalizationMode value, JsonSerializerOptions options) + { + switch (value) + { + case IcuNormalizationMode.Decompose: + writer.WriteStringValue("decompose"); + return; + case IcuNormalizationMode.Compose: + writer.WriteStringValue("compose"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuNormalizationTypeConverter))] +public enum IcuNormalizationType +{ + [EnumMember(Value = "nfkc_cf")] + NfkcCf, + [EnumMember(Value = "nfkc")] + Nfkc, + [EnumMember(Value = "nfc")] + Nfc +} + +internal sealed class IcuNormalizationTypeConverter : JsonConverter +{ + public override IcuNormalizationType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "nfkc_cf": + return IcuNormalizationType.NfkcCf; + case "nfkc": + return IcuNormalizationType.Nfkc; + case "nfc": + return IcuNormalizationType.Nfc; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuNormalizationType value, JsonSerializerOptions options) + { + switch (value) + { + case IcuNormalizationType.NfkcCf: + writer.WriteStringValue("nfkc_cf"); + return; + case IcuNormalizationType.Nfkc: + writer.WriteStringValue("nfkc"); + return; + case IcuNormalizationType.Nfc: + writer.WriteStringValue("nfc"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IcuTransformDirectionConverter))] +public enum IcuTransformDirection +{ + [EnumMember(Value = "reverse")] + Reverse, + [EnumMember(Value = "forward")] + Forward +} + +internal sealed class IcuTransformDirectionConverter : JsonConverter +{ + public override IcuTransformDirection Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "reverse": + return IcuTransformDirection.Reverse; + case "forward": + return IcuTransformDirection.Forward; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IcuTransformDirection value, JsonSerializerOptions options) + { + switch (value) + { + case IcuTransformDirection.Reverse: + writer.WriteStringValue("reverse"); + return; + case IcuTransformDirection.Forward: + writer.WriteStringValue("forward"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(KeepTypesModeConverter))] +public enum KeepTypesMode +{ + [EnumMember(Value = "include")] + Include, + [EnumMember(Value = "exclude")] + Exclude +} + +internal sealed class KeepTypesModeConverter : JsonConverter +{ + public override KeepTypesMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "include": + return KeepTypesMode.Include; + case "exclude": + return KeepTypesMode.Exclude; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, KeepTypesMode value, JsonSerializerOptions options) + { + switch (value) + { + case KeepTypesMode.Include: + writer.WriteStringValue("include"); + return; + case KeepTypesMode.Exclude: + writer.WriteStringValue("exclude"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(KuromojiTokenizationModeConverter))] +public enum KuromojiTokenizationMode +{ + [EnumMember(Value = "search")] + Search, + [EnumMember(Value = "normal")] + Normal, + [EnumMember(Value = "extended")] + Extended +} + +internal sealed class KuromojiTokenizationModeConverter : JsonConverter +{ + public override KuromojiTokenizationMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "search": + return KuromojiTokenizationMode.Search; + case "normal": + return KuromojiTokenizationMode.Normal; + case "extended": + return KuromojiTokenizationMode.Extended; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, KuromojiTokenizationMode value, JsonSerializerOptions options) + { + switch (value) + { + case KuromojiTokenizationMode.Search: + writer.WriteStringValue("search"); + return; + case KuromojiTokenizationMode.Normal: + writer.WriteStringValue("normal"); + return; + case KuromojiTokenizationMode.Extended: + writer.WriteStringValue("extended"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(LanguageConverter))] +public enum Language +{ + [EnumMember(Value = "Turkish")] + Turkish, + [EnumMember(Value = "Thai")] + Thai, + [EnumMember(Value = "Swedish")] + Swedish, + [EnumMember(Value = "Spanish")] + Spanish, + [EnumMember(Value = "Sorani")] + Sorani, + [EnumMember(Value = "Russian")] + Russian, + [EnumMember(Value = "Romanian")] + Romanian, + [EnumMember(Value = "Portuguese")] + Portuguese, + [EnumMember(Value = "Persian")] + Persian, + [EnumMember(Value = "Norwegian")] + Norwegian, + [EnumMember(Value = "Latvian")] + Latvian, + [EnumMember(Value = "Italian")] + Italian, + [EnumMember(Value = "Irish")] + Irish, + [EnumMember(Value = "Indonesian")] + Indonesian, + [EnumMember(Value = "Hungarian")] + Hungarian, + [EnumMember(Value = "Hindi")] + Hindi, + [EnumMember(Value = "Greek")] + Greek, + [EnumMember(Value = "German")] + German, + [EnumMember(Value = "Galician")] + Galician, + [EnumMember(Value = "French")] + French, + [EnumMember(Value = "Finnish")] + Finnish, + [EnumMember(Value = "Estonian")] + Estonian, + [EnumMember(Value = "English")] + English, + [EnumMember(Value = "Dutch")] + Dutch, + [EnumMember(Value = "Danish")] + Danish, + [EnumMember(Value = "Czech")] + Czech, + [EnumMember(Value = "Cjk")] + Cjk, + [EnumMember(Value = "Chinese")] + Chinese, + [EnumMember(Value = "Catalan")] + Catalan, + [EnumMember(Value = "Bulgarian")] + Bulgarian, + [EnumMember(Value = "Brazilian")] + Brazilian, + [EnumMember(Value = "Basque")] + Basque, + [EnumMember(Value = "Armenian")] + Armenian, + [EnumMember(Value = "Arabic")] + Arabic +} + +internal sealed class LanguageConverter : JsonConverter +{ + public override Language Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "Turkish": + return Language.Turkish; + case "Thai": + return Language.Thai; + case "Swedish": + return Language.Swedish; + case "Spanish": + return Language.Spanish; + case "Sorani": + return Language.Sorani; + case "Russian": + return Language.Russian; + case "Romanian": + return Language.Romanian; + case "Portuguese": + return Language.Portuguese; + case "Persian": + return Language.Persian; + case "Norwegian": + return Language.Norwegian; + case "Latvian": + return Language.Latvian; + case "Italian": + return Language.Italian; + case "Irish": + return Language.Irish; + case "Indonesian": + return Language.Indonesian; + case "Hungarian": + return Language.Hungarian; + case "Hindi": + return Language.Hindi; + case "Greek": + return Language.Greek; + case "German": + return Language.German; + case "Galician": + return Language.Galician; + case "French": + return Language.French; + case "Finnish": + return Language.Finnish; + case "Estonian": + return Language.Estonian; + case "English": + return Language.English; + case "Dutch": + return Language.Dutch; + case "Danish": + return Language.Danish; + case "Czech": + return Language.Czech; + case "Cjk": + return Language.Cjk; + case "Chinese": + return Language.Chinese; + case "Catalan": + return Language.Catalan; + case "Bulgarian": + return Language.Bulgarian; + case "Brazilian": + return Language.Brazilian; + case "Basque": + return Language.Basque; + case "Armenian": + return Language.Armenian; + case "Arabic": + return Language.Arabic; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Language value, JsonSerializerOptions options) + { + switch (value) + { + case Language.Turkish: + writer.WriteStringValue("Turkish"); + return; + case Language.Thai: + writer.WriteStringValue("Thai"); + return; + case Language.Swedish: + writer.WriteStringValue("Swedish"); + return; + case Language.Spanish: + writer.WriteStringValue("Spanish"); + return; + case Language.Sorani: + writer.WriteStringValue("Sorani"); + return; + case Language.Russian: + writer.WriteStringValue("Russian"); + return; + case Language.Romanian: + writer.WriteStringValue("Romanian"); + return; + case Language.Portuguese: + writer.WriteStringValue("Portuguese"); + return; + case Language.Persian: + writer.WriteStringValue("Persian"); + return; + case Language.Norwegian: + writer.WriteStringValue("Norwegian"); + return; + case Language.Latvian: + writer.WriteStringValue("Latvian"); + return; + case Language.Italian: + writer.WriteStringValue("Italian"); + return; + case Language.Irish: + writer.WriteStringValue("Irish"); + return; + case Language.Indonesian: + writer.WriteStringValue("Indonesian"); + return; + case Language.Hungarian: + writer.WriteStringValue("Hungarian"); + return; + case Language.Hindi: + writer.WriteStringValue("Hindi"); + return; + case Language.Greek: + writer.WriteStringValue("Greek"); + return; + case Language.German: + writer.WriteStringValue("German"); + return; + case Language.Galician: + writer.WriteStringValue("Galician"); + return; + case Language.French: + writer.WriteStringValue("French"); + return; + case Language.Finnish: + writer.WriteStringValue("Finnish"); + return; + case Language.Estonian: + writer.WriteStringValue("Estonian"); + return; + case Language.English: + writer.WriteStringValue("English"); + return; + case Language.Dutch: + writer.WriteStringValue("Dutch"); + return; + case Language.Danish: + writer.WriteStringValue("Danish"); + return; + case Language.Czech: + writer.WriteStringValue("Czech"); + return; + case Language.Cjk: + writer.WriteStringValue("Cjk"); + return; + case Language.Chinese: + writer.WriteStringValue("Chinese"); + return; + case Language.Catalan: + writer.WriteStringValue("Catalan"); + return; + case Language.Bulgarian: + writer.WriteStringValue("Bulgarian"); + return; + case Language.Brazilian: + writer.WriteStringValue("Brazilian"); + return; + case Language.Basque: + writer.WriteStringValue("Basque"); + return; + case Language.Armenian: + writer.WriteStringValue("Armenian"); + return; + case Language.Arabic: + writer.WriteStringValue("Arabic"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(NoriDecompoundModeConverter))] +public enum NoriDecompoundMode +{ + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "mixed")] + Mixed, + [EnumMember(Value = "discard")] + Discard +} + +internal sealed class NoriDecompoundModeConverter : JsonConverter +{ + public override NoriDecompoundMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "none": + return NoriDecompoundMode.None; + case "mixed": + return NoriDecompoundMode.Mixed; + case "discard": + return NoriDecompoundMode.Discard; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, NoriDecompoundMode value, JsonSerializerOptions options) + { + switch (value) + { + case NoriDecompoundMode.None: + writer.WriteStringValue("none"); + return; + case NoriDecompoundMode.Mixed: + writer.WriteStringValue("mixed"); + return; + case NoriDecompoundMode.Discard: + writer.WriteStringValue("discard"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(PhoneticEncoderConverter))] +public enum PhoneticEncoder +{ + [EnumMember(Value = "soundex")] + Soundex, + [EnumMember(Value = "refined_soundex")] + RefinedSoundex, + [EnumMember(Value = "nysiis")] + Nysiis, + [EnumMember(Value = "metaphone")] + Metaphone, + [EnumMember(Value = "koelnerphonetik")] + Koelnerphonetik, + [EnumMember(Value = "haasephonetik")] + Haasephonetik, + [EnumMember(Value = "double_metaphone")] + DoubleMetaphone, + [EnumMember(Value = "daitch_mokotoff")] + DaitchMokotoff, + [EnumMember(Value = "cologne")] + Cologne, + [EnumMember(Value = "caverphone2")] + Caverphone2, + [EnumMember(Value = "caverphone1")] + Caverphone1, + [EnumMember(Value = "beider_morse")] + BeiderMorse +} + +internal sealed class PhoneticEncoderConverter : JsonConverter +{ + public override PhoneticEncoder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "soundex": + return PhoneticEncoder.Soundex; + case "refined_soundex": + return PhoneticEncoder.RefinedSoundex; + case "nysiis": + return PhoneticEncoder.Nysiis; + case "metaphone": + return PhoneticEncoder.Metaphone; + case "koelnerphonetik": + return PhoneticEncoder.Koelnerphonetik; + case "haasephonetik": + return PhoneticEncoder.Haasephonetik; + case "double_metaphone": + return PhoneticEncoder.DoubleMetaphone; + case "daitch_mokotoff": + return PhoneticEncoder.DaitchMokotoff; + case "cologne": + return PhoneticEncoder.Cologne; + case "caverphone2": + return PhoneticEncoder.Caverphone2; + case "caverphone1": + return PhoneticEncoder.Caverphone1; + case "beider_morse": + return PhoneticEncoder.BeiderMorse; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, PhoneticEncoder value, JsonSerializerOptions options) + { + switch (value) + { + case PhoneticEncoder.Soundex: + writer.WriteStringValue("soundex"); + return; + case PhoneticEncoder.RefinedSoundex: + writer.WriteStringValue("refined_soundex"); + return; + case PhoneticEncoder.Nysiis: + writer.WriteStringValue("nysiis"); + return; + case PhoneticEncoder.Metaphone: + writer.WriteStringValue("metaphone"); + return; + case PhoneticEncoder.Koelnerphonetik: + writer.WriteStringValue("koelnerphonetik"); + return; + case PhoneticEncoder.Haasephonetik: + writer.WriteStringValue("haasephonetik"); + return; + case PhoneticEncoder.DoubleMetaphone: + writer.WriteStringValue("double_metaphone"); + return; + case PhoneticEncoder.DaitchMokotoff: + writer.WriteStringValue("daitch_mokotoff"); + return; + case PhoneticEncoder.Cologne: + writer.WriteStringValue("cologne"); + return; + case PhoneticEncoder.Caverphone2: + writer.WriteStringValue("caverphone2"); + return; + case PhoneticEncoder.Caverphone1: + writer.WriteStringValue("caverphone1"); + return; + case PhoneticEncoder.BeiderMorse: + writer.WriteStringValue("beider_morse"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(PhoneticLanguageConverter))] +public enum PhoneticLanguage +{ + [EnumMember(Value = "spanish")] + Spanish, + [EnumMember(Value = "russian")] + Russian, + [EnumMember(Value = "romanian")] + Romanian, + [EnumMember(Value = "polish")] + Polish, + [EnumMember(Value = "hungarian")] + Hungarian, + [EnumMember(Value = "hebrew")] + Hebrew, + [EnumMember(Value = "german")] + German, + [EnumMember(Value = "french")] + French, + [EnumMember(Value = "english")] + English, + [EnumMember(Value = "cyrillic")] + Cyrillic, + [EnumMember(Value = "common")] + Common, + [EnumMember(Value = "any")] + Any +} + +internal sealed class PhoneticLanguageConverter : JsonConverter +{ + public override PhoneticLanguage Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "spanish": + return PhoneticLanguage.Spanish; + case "russian": + return PhoneticLanguage.Russian; + case "romanian": + return PhoneticLanguage.Romanian; + case "polish": + return PhoneticLanguage.Polish; + case "hungarian": + return PhoneticLanguage.Hungarian; + case "hebrew": + return PhoneticLanguage.Hebrew; + case "german": + return PhoneticLanguage.German; + case "french": + return PhoneticLanguage.French; + case "english": + return PhoneticLanguage.English; + case "cyrillic": + return PhoneticLanguage.Cyrillic; + case "common": + return PhoneticLanguage.Common; + case "any": + return PhoneticLanguage.Any; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, PhoneticLanguage value, JsonSerializerOptions options) + { + switch (value) + { + case PhoneticLanguage.Spanish: + writer.WriteStringValue("spanish"); + return; + case PhoneticLanguage.Russian: + writer.WriteStringValue("russian"); + return; + case PhoneticLanguage.Romanian: + writer.WriteStringValue("romanian"); + return; + case PhoneticLanguage.Polish: + writer.WriteStringValue("polish"); + return; + case PhoneticLanguage.Hungarian: + writer.WriteStringValue("hungarian"); + return; + case PhoneticLanguage.Hebrew: + writer.WriteStringValue("hebrew"); + return; + case PhoneticLanguage.German: + writer.WriteStringValue("german"); + return; + case PhoneticLanguage.French: + writer.WriteStringValue("french"); + return; + case PhoneticLanguage.English: + writer.WriteStringValue("english"); + return; + case PhoneticLanguage.Cyrillic: + writer.WriteStringValue("cyrillic"); + return; + case PhoneticLanguage.Common: + writer.WriteStringValue("common"); + return; + case PhoneticLanguage.Any: + writer.WriteStringValue("any"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(PhoneticNameTypeConverter))] +public enum PhoneticNameType +{ + [EnumMember(Value = "sephardic")] + Sephardic, + [EnumMember(Value = "generic")] + Generic, + [EnumMember(Value = "ashkenazi")] + Ashkenazi +} + +internal sealed class PhoneticNameTypeConverter : JsonConverter +{ + public override PhoneticNameType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sephardic": + return PhoneticNameType.Sephardic; + case "generic": + return PhoneticNameType.Generic; + case "ashkenazi": + return PhoneticNameType.Ashkenazi; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, PhoneticNameType value, JsonSerializerOptions options) + { + switch (value) + { + case PhoneticNameType.Sephardic: + writer.WriteStringValue("sephardic"); + return; + case PhoneticNameType.Generic: + writer.WriteStringValue("generic"); + return; + case PhoneticNameType.Ashkenazi: + writer.WriteStringValue("ashkenazi"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(PhoneticRuleTypeConverter))] +public enum PhoneticRuleType +{ + [EnumMember(Value = "exact")] + Exact, + [EnumMember(Value = "approx")] + Approx +} + +internal sealed class PhoneticRuleTypeConverter : JsonConverter +{ + public override PhoneticRuleType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "exact": + return PhoneticRuleType.Exact; + case "approx": + return PhoneticRuleType.Approx; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, PhoneticRuleType value, JsonSerializerOptions options) + { + switch (value) + { + case PhoneticRuleType.Exact: + writer.WriteStringValue("exact"); + return; + case PhoneticRuleType.Approx: + writer.WriteStringValue("approx"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SnowballLanguageConverter))] +public enum SnowballLanguage +{ + [EnumMember(Value = "Turkish")] + Turkish, + [EnumMember(Value = "Swedish")] + Swedish, + [EnumMember(Value = "Spanish")] + Spanish, + [EnumMember(Value = "Russian")] + Russian, + [EnumMember(Value = "Romanian")] + Romanian, + [EnumMember(Value = "Portuguese")] + Portuguese, + [EnumMember(Value = "Porter")] + Porter, + [EnumMember(Value = "Norwegian")] + Norwegian, + [EnumMember(Value = "Lovins")] + Lovins, + [EnumMember(Value = "Kp")] + Kp, + [EnumMember(Value = "Italian")] + Italian, + [EnumMember(Value = "Hungarian")] + Hungarian, + [EnumMember(Value = "German2")] + German2, + [EnumMember(Value = "German")] + German, + [EnumMember(Value = "French")] + French, + [EnumMember(Value = "Finnish")] + Finnish, + [EnumMember(Value = "English")] + English, + [EnumMember(Value = "Dutch")] + Dutch, + [EnumMember(Value = "Danish")] + Danish, + [EnumMember(Value = "Catalan")] + Catalan, + [EnumMember(Value = "Basque")] + Basque, + [EnumMember(Value = "Armenian")] + Armenian +} + +internal sealed class SnowballLanguageConverter : JsonConverter +{ + public override SnowballLanguage Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "Turkish": + return SnowballLanguage.Turkish; + case "Swedish": + return SnowballLanguage.Swedish; + case "Spanish": + return SnowballLanguage.Spanish; + case "Russian": + return SnowballLanguage.Russian; + case "Romanian": + return SnowballLanguage.Romanian; + case "Portuguese": + return SnowballLanguage.Portuguese; + case "Porter": + return SnowballLanguage.Porter; + case "Norwegian": + return SnowballLanguage.Norwegian; + case "Lovins": + return SnowballLanguage.Lovins; + case "Kp": + return SnowballLanguage.Kp; + case "Italian": + return SnowballLanguage.Italian; + case "Hungarian": + return SnowballLanguage.Hungarian; + case "German2": + return SnowballLanguage.German2; + case "German": + return SnowballLanguage.German; + case "French": + return SnowballLanguage.French; + case "Finnish": + return SnowballLanguage.Finnish; + case "English": + return SnowballLanguage.English; + case "Dutch": + return SnowballLanguage.Dutch; + case "Danish": + return SnowballLanguage.Danish; + case "Catalan": + return SnowballLanguage.Catalan; + case "Basque": + return SnowballLanguage.Basque; + case "Armenian": + return SnowballLanguage.Armenian; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SnowballLanguage value, JsonSerializerOptions options) + { + switch (value) + { + case SnowballLanguage.Turkish: + writer.WriteStringValue("Turkish"); + return; + case SnowballLanguage.Swedish: + writer.WriteStringValue("Swedish"); + return; + case SnowballLanguage.Spanish: + writer.WriteStringValue("Spanish"); + return; + case SnowballLanguage.Russian: + writer.WriteStringValue("Russian"); + return; + case SnowballLanguage.Romanian: + writer.WriteStringValue("Romanian"); + return; + case SnowballLanguage.Portuguese: + writer.WriteStringValue("Portuguese"); + return; + case SnowballLanguage.Porter: + writer.WriteStringValue("Porter"); + return; + case SnowballLanguage.Norwegian: + writer.WriteStringValue("Norwegian"); + return; + case SnowballLanguage.Lovins: + writer.WriteStringValue("Lovins"); + return; + case SnowballLanguage.Kp: + writer.WriteStringValue("Kp"); + return; + case SnowballLanguage.Italian: + writer.WriteStringValue("Italian"); + return; + case SnowballLanguage.Hungarian: + writer.WriteStringValue("Hungarian"); + return; + case SnowballLanguage.German2: + writer.WriteStringValue("German2"); + return; + case SnowballLanguage.German: + writer.WriteStringValue("German"); + return; + case SnowballLanguage.French: + writer.WriteStringValue("French"); + return; + case SnowballLanguage.Finnish: + writer.WriteStringValue("Finnish"); + return; + case SnowballLanguage.English: + writer.WriteStringValue("English"); + return; + case SnowballLanguage.Dutch: + writer.WriteStringValue("Dutch"); + return; + case SnowballLanguage.Danish: + writer.WriteStringValue("Danish"); + return; + case SnowballLanguage.Catalan: + writer.WriteStringValue("Catalan"); + return; + case SnowballLanguage.Basque: + writer.WriteStringValue("Basque"); + return; + case SnowballLanguage.Armenian: + writer.WriteStringValue("Armenian"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SynonymFormatConverter))] +public enum SynonymFormat +{ + [EnumMember(Value = "wordnet")] + Wordnet, + [EnumMember(Value = "solr")] + Solr +} + +internal sealed class SynonymFormatConverter : JsonConverter +{ + public override SynonymFormat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "wordnet": + return SynonymFormat.Wordnet; + case "solr": + return SynonymFormat.Solr; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SynonymFormat value, JsonSerializerOptions options) + { + switch (value) + { + case SynonymFormat.Wordnet: + writer.WriteStringValue("wordnet"); + return; + case SynonymFormat.Solr: + writer.WriteStringValue("solr"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TokenCharConverter))] +public enum TokenChar +{ + [EnumMember(Value = "whitespace")] + Whitespace, + [EnumMember(Value = "symbol")] + Symbol, + [EnumMember(Value = "punctuation")] + Punctuation, + [EnumMember(Value = "letter")] + Letter, + [EnumMember(Value = "digit")] + Digit, + [EnumMember(Value = "custom")] + Custom +} + +internal sealed class TokenCharConverter : JsonConverter +{ + public override TokenChar Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "whitespace": + return TokenChar.Whitespace; + case "symbol": + return TokenChar.Symbol; + case "punctuation": + return TokenChar.Punctuation; + case "letter": + return TokenChar.Letter; + case "digit": + return TokenChar.Digit; + case "custom": + return TokenChar.Custom; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TokenChar value, JsonSerializerOptions options) + { + switch (value) + { + case TokenChar.Whitespace: + writer.WriteStringValue("whitespace"); + return; + case TokenChar.Symbol: + writer.WriteStringValue("symbol"); + return; + case TokenChar.Punctuation: + writer.WriteStringValue("punctuation"); + return; + case TokenChar.Letter: + writer.WriteStringValue("letter"); + return; + case TokenChar.Digit: + writer.WriteStringValue("digit"); + return; + case TokenChar.Custom: + writer.WriteStringValue("custom"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Cluster.g.cs new file mode 100644 index 00000000000..4df256768bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Cluster.g.cs @@ -0,0 +1,299 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +[JsonConverter(typeof(AllocationExplainDecisionConverter))] +public enum AllocationExplainDecision +{ + [EnumMember(Value = "YES")] + Yes, + [EnumMember(Value = "THROTTLE")] + Throttle, + [EnumMember(Value = "NO")] + No, + [EnumMember(Value = "ALWAYS")] + Always +} + +internal sealed class AllocationExplainDecisionConverter : JsonConverter +{ + public override AllocationExplainDecision Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "YES": + return AllocationExplainDecision.Yes; + case "THROTTLE": + return AllocationExplainDecision.Throttle; + case "NO": + return AllocationExplainDecision.No; + case "ALWAYS": + return AllocationExplainDecision.Always; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, AllocationExplainDecision value, JsonSerializerOptions options) + { + switch (value) + { + case AllocationExplainDecision.Yes: + writer.WriteStringValue("YES"); + return; + case AllocationExplainDecision.Throttle: + writer.WriteStringValue("THROTTLE"); + return; + case AllocationExplainDecision.No: + writer.WriteStringValue("NO"); + return; + case AllocationExplainDecision.Always: + writer.WriteStringValue("ALWAYS"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DecisionConverter))] +public enum Decision +{ + [EnumMember(Value = "yes")] + Yes, + [EnumMember(Value = "worse_balance")] + WorseBalance, + [EnumMember(Value = "throttled")] + Throttled, + [EnumMember(Value = "no_valid_shard_copy")] + NoValidShardCopy, + [EnumMember(Value = "no_attempt")] + NoAttempt, + [EnumMember(Value = "no")] + No, + [EnumMember(Value = "awaiting_info")] + AwaitingInfo, + [EnumMember(Value = "allocation_delayed")] + AllocationDelayed +} + +internal sealed class DecisionConverter : JsonConverter +{ + public override Decision Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yes": + return Decision.Yes; + case "worse_balance": + return Decision.WorseBalance; + case "throttled": + return Decision.Throttled; + case "no_valid_shard_copy": + return Decision.NoValidShardCopy; + case "no_attempt": + return Decision.NoAttempt; + case "no": + return Decision.No; + case "awaiting_info": + return Decision.AwaitingInfo; + case "allocation_delayed": + return Decision.AllocationDelayed; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Decision value, JsonSerializerOptions options) + { + switch (value) + { + case Decision.Yes: + writer.WriteStringValue("yes"); + return; + case Decision.WorseBalance: + writer.WriteStringValue("worse_balance"); + return; + case Decision.Throttled: + writer.WriteStringValue("throttled"); + return; + case Decision.NoValidShardCopy: + writer.WriteStringValue("no_valid_shard_copy"); + return; + case Decision.NoAttempt: + writer.WriteStringValue("no_attempt"); + return; + case Decision.No: + writer.WriteStringValue("no"); + return; + case Decision.AwaitingInfo: + writer.WriteStringValue("awaiting_info"); + return; + case Decision.AllocationDelayed: + writer.WriteStringValue("allocation_delayed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(UnassignedInformationReasonConverter))] +public enum UnassignedInformationReason +{ + [EnumMember(Value = "REROUTE_CANCELLED")] + RerouteCancelled, + [EnumMember(Value = "REPLICA_ADDED")] + ReplicaAdded, + [EnumMember(Value = "REINITIALIZED")] + Reinitialized, + [EnumMember(Value = "REALLOCATED_REPLICA")] + ReallocatedReplica, + [EnumMember(Value = "PRIMARY_FAILED")] + PrimaryFailed, + [EnumMember(Value = "NODE_LEFT")] + NodeLeft, + [EnumMember(Value = "NEW_INDEX_RESTORED")] + NewIndexRestored, + [EnumMember(Value = "MANUAL_ALLOCATION")] + ManualAllocation, + [EnumMember(Value = "INDEX_REOPENED")] + IndexReopened, + [EnumMember(Value = "INDEX_CREATED")] + IndexCreated, + [EnumMember(Value = "FORCED_EMPTY_PRIMARY")] + ForcedEmptyPrimary, + [EnumMember(Value = "EXISTING_INDEX_RESTORED")] + ExistingIndexRestored, + [EnumMember(Value = "DANGLING_INDEX_IMPORTED")] + DanglingIndexImported, + [EnumMember(Value = "CLUSTER_RECOVERED")] + ClusterRecovered, + [EnumMember(Value = "ALLOCATION_FAILED")] + AllocationFailed +} + +internal sealed class UnassignedInformationReasonConverter : JsonConverter +{ + public override UnassignedInformationReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "REROUTE_CANCELLED": + return UnassignedInformationReason.RerouteCancelled; + case "REPLICA_ADDED": + return UnassignedInformationReason.ReplicaAdded; + case "REINITIALIZED": + return UnassignedInformationReason.Reinitialized; + case "REALLOCATED_REPLICA": + return UnassignedInformationReason.ReallocatedReplica; + case "PRIMARY_FAILED": + return UnassignedInformationReason.PrimaryFailed; + case "NODE_LEFT": + return UnassignedInformationReason.NodeLeft; + case "NEW_INDEX_RESTORED": + return UnassignedInformationReason.NewIndexRestored; + case "MANUAL_ALLOCATION": + return UnassignedInformationReason.ManualAllocation; + case "INDEX_REOPENED": + return UnassignedInformationReason.IndexReopened; + case "INDEX_CREATED": + return UnassignedInformationReason.IndexCreated; + case "FORCED_EMPTY_PRIMARY": + return UnassignedInformationReason.ForcedEmptyPrimary; + case "EXISTING_INDEX_RESTORED": + return UnassignedInformationReason.ExistingIndexRestored; + case "DANGLING_INDEX_IMPORTED": + return UnassignedInformationReason.DanglingIndexImported; + case "CLUSTER_RECOVERED": + return UnassignedInformationReason.ClusterRecovered; + case "ALLOCATION_FAILED": + return UnassignedInformationReason.AllocationFailed; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, UnassignedInformationReason value, JsonSerializerOptions options) + { + switch (value) + { + case UnassignedInformationReason.RerouteCancelled: + writer.WriteStringValue("REROUTE_CANCELLED"); + return; + case UnassignedInformationReason.ReplicaAdded: + writer.WriteStringValue("REPLICA_ADDED"); + return; + case UnassignedInformationReason.Reinitialized: + writer.WriteStringValue("REINITIALIZED"); + return; + case UnassignedInformationReason.ReallocatedReplica: + writer.WriteStringValue("REALLOCATED_REPLICA"); + return; + case UnassignedInformationReason.PrimaryFailed: + writer.WriteStringValue("PRIMARY_FAILED"); + return; + case UnassignedInformationReason.NodeLeft: + writer.WriteStringValue("NODE_LEFT"); + return; + case UnassignedInformationReason.NewIndexRestored: + writer.WriteStringValue("NEW_INDEX_RESTORED"); + return; + case UnassignedInformationReason.ManualAllocation: + writer.WriteStringValue("MANUAL_ALLOCATION"); + return; + case UnassignedInformationReason.IndexReopened: + writer.WriteStringValue("INDEX_REOPENED"); + return; + case UnassignedInformationReason.IndexCreated: + writer.WriteStringValue("INDEX_CREATED"); + return; + case UnassignedInformationReason.ForcedEmptyPrimary: + writer.WriteStringValue("FORCED_EMPTY_PRIMARY"); + return; + case UnassignedInformationReason.ExistingIndexRestored: + writer.WriteStringValue("EXISTING_INDEX_RESTORED"); + return; + case UnassignedInformationReason.DanglingIndexImported: + writer.WriteStringValue("DANGLING_INDEX_IMPORTED"); + return; + case UnassignedInformationReason.ClusterRecovered: + writer.WriteStringValue("CLUSTER_RECOVERED"); + return; + case UnassignedInformationReason.AllocationFailed: + writer.WriteStringValue("ALLOCATION_FAILED"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.Search.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.Search.g.cs new file mode 100644 index 00000000000..f2b50a3247f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.Search.g.cs @@ -0,0 +1,500 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +[JsonConverter(typeof(BoundaryScannerConverter))] +public enum BoundaryScanner +{ + /// + /// Break highlighted fragments at the next word boundary, as determined by Java’s `BreakIterator`.
You can specify the locale to use with `boundary_scanner_locale`.
+ ///
+ [EnumMember(Value = "word")] + Word, + /// + /// Break highlighted fragments at the next sentence boundary, as determined by Java’s `BreakIterator`.
You can specify the locale to use with `boundary_scanner_locale`.
When used with the `unified` highlighter, the `sentence` scanner splits sentences bigger than `fragment_size` at the first word boundary next to fragment_size.
You can set `fragment_size` to `0` to never split any sentence.
+ ///
+ [EnumMember(Value = "sentence")] + Sentence, + /// + /// Use the characters specified by `boundary_chars` as highlighting boundaries.
The `boundary_max_scan` setting controls how far to scan for boundary characters.
Only valid for the `fvh` highlighter.
+ ///
+ [EnumMember(Value = "chars")] + Chars +} + +internal sealed class BoundaryScannerConverter : JsonConverter +{ + public override BoundaryScanner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "word": + return BoundaryScanner.Word; + case "sentence": + return BoundaryScanner.Sentence; + case "chars": + return BoundaryScanner.Chars; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, BoundaryScanner value, JsonSerializerOptions options) + { + switch (value) + { + case BoundaryScanner.Word: + writer.WriteStringValue("word"); + return; + case BoundaryScanner.Sentence: + writer.WriteStringValue("sentence"); + return; + case BoundaryScanner.Chars: + writer.WriteStringValue("chars"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(HighlighterEncoderConverter))] +public enum HighlighterEncoder +{ + [EnumMember(Value = "html")] + Html, + [EnumMember(Value = "default")] + Default +} + +internal sealed class HighlighterEncoderConverter : JsonConverter +{ + public override HighlighterEncoder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "html": + return HighlighterEncoder.Html; + case "default": + return HighlighterEncoder.Default; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, HighlighterEncoder value, JsonSerializerOptions options) + { + switch (value) + { + case HighlighterEncoder.Html: + writer.WriteStringValue("html"); + return; + case HighlighterEncoder.Default: + writer.WriteStringValue("default"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(HighlighterFragmenterConverter))] +public enum HighlighterFragmenter +{ + [EnumMember(Value = "span")] + Span, + [EnumMember(Value = "simple")] + Simple +} + +internal sealed class HighlighterFragmenterConverter : JsonConverter +{ + public override HighlighterFragmenter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "span": + return HighlighterFragmenter.Span; + case "simple": + return HighlighterFragmenter.Simple; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, HighlighterFragmenter value, JsonSerializerOptions options) + { + switch (value) + { + case HighlighterFragmenter.Span: + writer.WriteStringValue("span"); + return; + case HighlighterFragmenter.Simple: + writer.WriteStringValue("simple"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(HighlighterOrderConverter))] +public enum HighlighterOrder +{ + [EnumMember(Value = "score")] + Score +} + +internal sealed class HighlighterOrderConverter : JsonConverter +{ + public override HighlighterOrder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "score": + return HighlighterOrder.Score; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, HighlighterOrder value, JsonSerializerOptions options) + { + switch (value) + { + case HighlighterOrder.Score: + writer.WriteStringValue("score"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(HighlighterTagsSchemaConverter))] +public enum HighlighterTagsSchema +{ + [EnumMember(Value = "styled")] + Styled +} + +internal sealed class HighlighterTagsSchemaConverter : JsonConverter +{ + public override HighlighterTagsSchema Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "styled": + return HighlighterTagsSchema.Styled; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, HighlighterTagsSchema value, JsonSerializerOptions options) + { + switch (value) + { + case HighlighterTagsSchema.Styled: + writer.WriteStringValue("styled"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(EnumStructConverter))] +public readonly partial struct HighlighterType : IEnumStruct +{ + public HighlighterType(string value) => Value = value; + + HighlighterType IEnumStruct.Create(string value) => value; + + public readonly string Value { get; } + + /// + /// The unified highlighter uses the Lucene Unified Highlighter. + /// + public static HighlighterType Unified { get; } = new HighlighterType("unified"); + + /// + /// The `plain` highlighter uses the standard Lucene highlighter + /// + public static HighlighterType Plain { get; } = new HighlighterType("plain"); + + /// + /// The fvh highlighter uses the Lucene Fast Vector highlighter. + /// + public static HighlighterType FastVector { get; } = new HighlighterType("fvh"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(HighlighterType highlighterType) => highlighterType.Value; + public static implicit operator HighlighterType(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is HighlighterType other && this.Equals(other); + public bool Equals(HighlighterType other) => Value == other.Value; + + public static bool operator ==(HighlighterType a, HighlighterType b) => a.Equals(b); + public static bool operator !=(HighlighterType a, HighlighterType b) => !(a == b); +} + +[JsonConverter(typeof(ScoreModeConverter))] +public enum ScoreMode +{ + /// + /// Add the original score and the rescore query score. + /// + [EnumMember(Value = "total")] + Total, + /// + /// Multiply the original score by the rescore query score.
Useful for `function` query rescores.
+ ///
+ [EnumMember(Value = "multiply")] + Multiply, + /// + /// Take the min of the original score and the rescore query score. + /// + [EnumMember(Value = "min")] + Min, + /// + /// Take the max of original score and the rescore query score. + /// + [EnumMember(Value = "max")] + Max, + /// + /// Average the original score and the rescore query score. + /// + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class ScoreModeConverter : JsonConverter +{ + public override ScoreMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "total": + return ScoreMode.Total; + case "multiply": + return ScoreMode.Multiply; + case "min": + return ScoreMode.Min; + case "max": + return ScoreMode.Max; + case "avg": + return ScoreMode.Avg; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ScoreMode value, JsonSerializerOptions options) + { + switch (value) + { + case ScoreMode.Total: + writer.WriteStringValue("total"); + return; + case ScoreMode.Multiply: + writer.WriteStringValue("multiply"); + return; + case ScoreMode.Min: + writer.WriteStringValue("min"); + return; + case ScoreMode.Max: + writer.WriteStringValue("max"); + return; + case ScoreMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(StringDistanceConverter))] +public enum StringDistance +{ + [EnumMember(Value = "ngram")] + Ngram, + [EnumMember(Value = "levenshtein")] + Levenshtein, + [EnumMember(Value = "jaro_winkler")] + JaroWinkler, + [EnumMember(Value = "internal")] + Internal, + [EnumMember(Value = "damerau_levenshtein")] + DamerauLevenshtein +} + +internal sealed class StringDistanceConverter : JsonConverter +{ + public override StringDistance Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "ngram": + return StringDistance.Ngram; + case "levenshtein": + return StringDistance.Levenshtein; + case "jaro_winkler": + return StringDistance.JaroWinkler; + case "internal": + return StringDistance.Internal; + case "damerau_levenshtein": + return StringDistance.DamerauLevenshtein; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, StringDistance value, JsonSerializerOptions options) + { + switch (value) + { + case StringDistance.Ngram: + writer.WriteStringValue("ngram"); + return; + case StringDistance.Levenshtein: + writer.WriteStringValue("levenshtein"); + return; + case StringDistance.JaroWinkler: + writer.WriteStringValue("jaro_winkler"); + return; + case StringDistance.Internal: + writer.WriteStringValue("internal"); + return; + case StringDistance.DamerauLevenshtein: + writer.WriteStringValue("damerau_levenshtein"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SuggestSortConverter))] +public enum SuggestSort +{ + [EnumMember(Value = "score")] + Score, + [EnumMember(Value = "frequency")] + Frequency +} + +internal sealed class SuggestSortConverter : JsonConverter +{ + public override SuggestSort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "score": + return SuggestSort.Score; + case "frequency": + return SuggestSort.Frequency; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SuggestSort value, JsonSerializerOptions options) + { + switch (value) + { + case SuggestSort.Score: + writer.WriteStringValue("score"); + return; + case SuggestSort.Frequency: + writer.WriteStringValue("frequency"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TotalHitsRelationConverter))] +public enum TotalHitsRelation +{ + /// + /// Lower bound, including returned events or sequences + /// + [EnumMember(Value = "gte")] + Gte, + /// + /// Accurate + /// + [EnumMember(Value = "eq")] + Eq +} + +internal sealed class TotalHitsRelationConverter : JsonConverter +{ + public override TotalHitsRelation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "gte": + return TotalHitsRelation.Gte; + case "eq": + return TotalHitsRelation.Eq; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TotalHitsRelation value, JsonSerializerOptions options) + { + switch (value) + { + case TotalHitsRelation.Gte: + writer.WriteStringValue("gte"); + return; + case TotalHitsRelation.Eq: + writer.WriteStringValue("eq"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Enrich.g.cs new file mode 100644 index 00000000000..4e3aed21ac5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Enrich.g.cs @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; + +[JsonConverter(typeof(EnrichPolicyPhaseConverter))] +public enum EnrichPolicyPhase +{ + [EnumMember(Value = "SCHEDULED")] + Scheduled, + [EnumMember(Value = "RUNNING")] + Running, + [EnumMember(Value = "FAILED")] + Failed, + [EnumMember(Value = "COMPLETE")] + Complete +} + +internal sealed class EnrichPolicyPhaseConverter : JsonConverter +{ + public override EnrichPolicyPhase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "SCHEDULED": + return EnrichPolicyPhase.Scheduled; + case "RUNNING": + return EnrichPolicyPhase.Running; + case "FAILED": + return EnrichPolicyPhase.Failed; + case "COMPLETE": + return EnrichPolicyPhase.Complete; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, EnrichPolicyPhase value, JsonSerializerOptions options) + { + switch (value) + { + case EnrichPolicyPhase.Scheduled: + writer.WriteStringValue("SCHEDULED"); + return; + case EnrichPolicyPhase.Running: + writer.WriteStringValue("RUNNING"); + return; + case EnrichPolicyPhase.Failed: + writer.WriteStringValue("FAILED"); + return; + case EnrichPolicyPhase.Complete: + writer.WriteStringValue("COMPLETE"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(PolicyTypeConverter))] +public enum PolicyType +{ + [EnumMember(Value = "range")] + Range, + [EnumMember(Value = "match")] + Match, + [EnumMember(Value = "geo_match")] + GeoMatch +} + +internal sealed class PolicyTypeConverter : JsonConverter +{ + public override PolicyType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "range": + return PolicyType.Range; + case "match": + return PolicyType.Match; + case "geo_match": + return PolicyType.GeoMatch; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, PolicyType value, JsonSerializerOptions options) + { + switch (value) + { + case PolicyType.Range: + writer.WriteStringValue("range"); + return; + case PolicyType.Match: + writer.WriteStringValue("match"); + return; + case PolicyType.GeoMatch: + writer.WriteStringValue("geo_match"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.IndexManagement.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.IndexManagement.g.cs new file mode 100644 index 00000000000..688b9982cc2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.IndexManagement.g.cs @@ -0,0 +1,590 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +[JsonConverter(typeof(FeatureConverter))] +public enum Feature +{ + [EnumMember(Value = "settings")] + Settings, + [EnumMember(Value = "mappings")] + Mappings, + [EnumMember(Value = "aliases")] + Aliases +} + +internal sealed class FeatureConverter : JsonConverter +{ + public override Feature Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "settings": + return Feature.Settings; + case "mappings": + return Feature.Mappings; + case "aliases": + return Feature.Aliases; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Feature value, JsonSerializerOptions options) + { + switch (value) + { + case Feature.Settings: + writer.WriteStringValue("settings"); + return; + case Feature.Mappings: + writer.WriteStringValue("mappings"); + return; + case Feature.Aliases: + writer.WriteStringValue("aliases"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndexCheckOnStartupConverter))] +public enum IndexCheckOnStartup +{ + [EnumMember(Value = "true")] + True, + [EnumMember(Value = "false")] + False, + [EnumMember(Value = "checksum")] + Checksum +} + +internal sealed class IndexCheckOnStartupConverter : JsonConverter +{ + public override IndexCheckOnStartup Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "true": + return IndexCheckOnStartup.True; + case "false": + return IndexCheckOnStartup.False; + case "checksum": + return IndexCheckOnStartup.Checksum; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IndexCheckOnStartup value, JsonSerializerOptions options) + { + switch (value) + { + case IndexCheckOnStartup.True: + writer.WriteStringValue("true"); + return; + case IndexCheckOnStartup.False: + writer.WriteStringValue("false"); + return; + case IndexCheckOnStartup.Checksum: + writer.WriteStringValue("checksum"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndexMetadataStateConverter))] +public enum IndexMetadataState +{ + [EnumMember(Value = "open")] + Open, + [EnumMember(Value = "close")] + Close +} + +internal sealed class IndexMetadataStateConverter : JsonConverter +{ + public override IndexMetadataState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "open": + return IndexMetadataState.Open; + case "close": + return IndexMetadataState.Close; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IndexMetadataState value, JsonSerializerOptions options) + { + switch (value) + { + case IndexMetadataState.Open: + writer.WriteStringValue("open"); + return; + case IndexMetadataState.Close: + writer.WriteStringValue("close"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndexRoutingAllocationOptionsConverter))] +public enum IndexRoutingAllocationOptions +{ + [EnumMember(Value = "primaries")] + Primaries, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "new_primaries")] + NewPrimaries, + [EnumMember(Value = "all")] + All +} + +internal sealed class IndexRoutingAllocationOptionsConverter : JsonConverter +{ + public override IndexRoutingAllocationOptions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "primaries": + return IndexRoutingAllocationOptions.Primaries; + case "none": + return IndexRoutingAllocationOptions.None; + case "new_primaries": + return IndexRoutingAllocationOptions.NewPrimaries; + case "all": + return IndexRoutingAllocationOptions.All; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IndexRoutingAllocationOptions value, JsonSerializerOptions options) + { + switch (value) + { + case IndexRoutingAllocationOptions.Primaries: + writer.WriteStringValue("primaries"); + return; + case IndexRoutingAllocationOptions.None: + writer.WriteStringValue("none"); + return; + case IndexRoutingAllocationOptions.NewPrimaries: + writer.WriteStringValue("new_primaries"); + return; + case IndexRoutingAllocationOptions.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndexRoutingRebalanceOptionsConverter))] +public enum IndexRoutingRebalanceOptions +{ + [EnumMember(Value = "replicas")] + Replicas, + [EnumMember(Value = "primaries")] + Primaries, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "all")] + All +} + +internal sealed class IndexRoutingRebalanceOptionsConverter : JsonConverter +{ + public override IndexRoutingRebalanceOptions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "replicas": + return IndexRoutingRebalanceOptions.Replicas; + case "primaries": + return IndexRoutingRebalanceOptions.Primaries; + case "none": + return IndexRoutingRebalanceOptions.None; + case "all": + return IndexRoutingRebalanceOptions.All; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IndexRoutingRebalanceOptions value, JsonSerializerOptions options) + { + switch (value) + { + case IndexRoutingRebalanceOptions.Replicas: + writer.WriteStringValue("replicas"); + return; + case IndexRoutingRebalanceOptions.Primaries: + writer.WriteStringValue("primaries"); + return; + case IndexRoutingRebalanceOptions.None: + writer.WriteStringValue("none"); + return; + case IndexRoutingRebalanceOptions.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(NumericFielddataFormatConverter))] +public enum NumericFielddataFormat +{ + [EnumMember(Value = "disabled")] + Disabled, + [EnumMember(Value = "array")] + Array +} + +internal sealed class NumericFielddataFormatConverter : JsonConverter +{ + public override NumericFielddataFormat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "disabled": + return NumericFielddataFormat.Disabled; + case "array": + return NumericFielddataFormat.Array; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, NumericFielddataFormat value, JsonSerializerOptions options) + { + switch (value) + { + case NumericFielddataFormat.Disabled: + writer.WriteStringValue("disabled"); + return; + case NumericFielddataFormat.Array: + writer.WriteStringValue("array"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SegmentSortMissingConverter))] +public enum SegmentSortMissing +{ + [EnumMember(Value = "_last")] + Last, + [EnumMember(Value = "_first")] + First +} + +internal sealed class SegmentSortMissingConverter : JsonConverter +{ + public override SegmentSortMissing Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "_last": + return SegmentSortMissing.Last; + case "_first": + return SegmentSortMissing.First; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SegmentSortMissing value, JsonSerializerOptions options) + { + switch (value) + { + case SegmentSortMissing.Last: + writer.WriteStringValue("_last"); + return; + case SegmentSortMissing.First: + writer.WriteStringValue("_first"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SegmentSortModeConverter))] +public enum SegmentSortMode +{ + [EnumMember(Value = "min")] + Min, + [EnumMember(Value = "max")] + Max +} + +internal sealed class SegmentSortModeConverter : JsonConverter +{ + public override SegmentSortMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "min": + case "MIN": + return SegmentSortMode.Min; + case "max": + case "MAX": + return SegmentSortMode.Max; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SegmentSortMode value, JsonSerializerOptions options) + { + switch (value) + { + case SegmentSortMode.Min: + writer.WriteStringValue("min"); + return; + case SegmentSortMode.Max: + writer.WriteStringValue("max"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SegmentSortOrderConverter))] +public enum SegmentSortOrder +{ + [EnumMember(Value = "desc")] + Desc, + [EnumMember(Value = "asc")] + Asc +} + +internal sealed class SegmentSortOrderConverter : JsonConverter +{ + public override SegmentSortOrder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "desc": + case "DESC": + return SegmentSortOrder.Desc; + case "asc": + case "ASC": + return SegmentSortOrder.Asc; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SegmentSortOrder value, JsonSerializerOptions options) + { + switch (value) + { + case SegmentSortOrder.Desc: + writer.WriteStringValue("desc"); + return; + case SegmentSortOrder.Asc: + writer.WriteStringValue("asc"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ShardRoutingStateConverter))] +public enum ShardRoutingState +{ + [EnumMember(Value = "UNASSIGNED")] + Unassigned, + [EnumMember(Value = "STARTED")] + Started, + [EnumMember(Value = "RELOCATING")] + Relocating, + [EnumMember(Value = "INITIALIZING")] + Initializing +} + +internal sealed class ShardRoutingStateConverter : JsonConverter +{ + public override ShardRoutingState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "UNASSIGNED": + return ShardRoutingState.Unassigned; + case "STARTED": + return ShardRoutingState.Started; + case "RELOCATING": + return ShardRoutingState.Relocating; + case "INITIALIZING": + return ShardRoutingState.Initializing; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ShardRoutingState value, JsonSerializerOptions options) + { + switch (value) + { + case ShardRoutingState.Unassigned: + writer.WriteStringValue("UNASSIGNED"); + return; + case ShardRoutingState.Started: + writer.WriteStringValue("STARTED"); + return; + case ShardRoutingState.Relocating: + writer.WriteStringValue("RELOCATING"); + return; + case ShardRoutingState.Initializing: + writer.WriteStringValue("INITIALIZING"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(EnumStructConverter))] +public readonly partial struct StorageType : IEnumStruct +{ + public StorageType(string value) => Value = value; + + StorageType IEnumStruct.Create(string value) => value; + + public readonly string Value { get; } + + /// + /// 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.
+ ///
+ public static StorageType Niofs { get; } = new StorageType("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.
+ ///
+ public static StorageType Mmapfs { get; } = new StorageType("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.
+ ///
+ public static StorageType Hybridfs { get; } = new StorageType("hybridfs"); + + /// + /// 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.
+ ///
+ public static StorageType Fs { get; } = new StorageType("fs"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(StorageType storageType) => storageType.Value; + public static implicit operator StorageType(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is StorageType other && this.Equals(other); + public bool Equals(StorageType other) => Value == other.Value; + + public static bool operator ==(StorageType a, StorageType b) => a.Equals(b); + public static bool operator !=(StorageType a, StorageType b) => !(a == b); +} + +[JsonConverter(typeof(TranslogDurabilityConverter))] +public enum TranslogDurability +{ + /// + /// (default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes
will already have been committed to disk.
+ ///
+ [EnumMember(Value = "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.
+ ///
+ [EnumMember(Value = "async")] + Async +} + +internal sealed class TranslogDurabilityConverter : JsonConverter +{ + public override TranslogDurability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "request": + case "REQUEST": + return TranslogDurability.Request; + case "async": + case "ASYNC": + return TranslogDurability.Async; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TranslogDurability value, JsonSerializerOptions options) + { + switch (value) + { + case TranslogDurability.Request: + writer.WriteStringValue("request"); + return; + case TranslogDurability.Async: + writer.WriteStringValue("async"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs new file mode 100644 index 00000000000..80409bf52c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs @@ -0,0 +1,290 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +[JsonConverter(typeof(ConvertTypeConverter))] +public enum ConvertType +{ + [EnumMember(Value = "string")] + String, + [EnumMember(Value = "long")] + Long, + [EnumMember(Value = "integer")] + Integer, + [EnumMember(Value = "float")] + Float, + [EnumMember(Value = "double")] + Double, + [EnumMember(Value = "boolean")] + Boolean, + [EnumMember(Value = "auto")] + Auto +} + +internal sealed class ConvertTypeConverter : JsonConverter +{ + public override ConvertType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "string": + return ConvertType.String; + case "long": + return ConvertType.Long; + case "integer": + return ConvertType.Integer; + case "float": + return ConvertType.Float; + case "double": + return ConvertType.Double; + case "boolean": + return ConvertType.Boolean; + case "auto": + return ConvertType.Auto; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSerializerOptions options) + { + switch (value) + { + case ConvertType.String: + writer.WriteStringValue("string"); + return; + case ConvertType.Long: + writer.WriteStringValue("long"); + return; + case ConvertType.Integer: + writer.WriteStringValue("integer"); + return; + case ConvertType.Float: + writer.WriteStringValue("float"); + return; + case ConvertType.Double: + writer.WriteStringValue("double"); + return; + case ConvertType.Boolean: + writer.WriteStringValue("boolean"); + return; + case ConvertType.Auto: + writer.WriteStringValue("auto"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(JsonProcessorConflictStrategyConverter))] +public enum JsonProcessorConflictStrategy +{ + /// + /// Root fields that conflict with fields from the parsed JSON will be overridden. + /// + [EnumMember(Value = "replace")] + Replace, + /// + /// Conflicting fields will be merged. + /// + [EnumMember(Value = "merge")] + Merge +} + +internal sealed class JsonProcessorConflictStrategyConverter : JsonConverter +{ + public override JsonProcessorConflictStrategy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "replace": + return JsonProcessorConflictStrategy.Replace; + case "merge": + return JsonProcessorConflictStrategy.Merge; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, JsonProcessorConflictStrategy value, JsonSerializerOptions options) + { + switch (value) + { + case JsonProcessorConflictStrategy.Replace: + writer.WriteStringValue("replace"); + return; + case JsonProcessorConflictStrategy.Merge: + writer.WriteStringValue("merge"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ShapeTypeConverter))] +public enum ShapeType +{ + [EnumMember(Value = "shape")] + Shape, + [EnumMember(Value = "geo_shape")] + GeoShape +} + +internal sealed class ShapeTypeConverter : JsonConverter +{ + public override ShapeType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "shape": + return ShapeType.Shape; + case "geo_shape": + return ShapeType.GeoShape; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ShapeType value, JsonSerializerOptions options) + { + switch (value) + { + case ShapeType.Shape: + writer.WriteStringValue("shape"); + return; + case ShapeType.GeoShape: + writer.WriteStringValue("geo_shape"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(UserAgentPropertyConverter))] +public enum UserAgentProperty +{ + [EnumMember(Value = "PATCH")] + Patch, + [EnumMember(Value = "OS_NAME")] + OsName, + [EnumMember(Value = "OS_MINOR")] + OsMinor, + [EnumMember(Value = "OS_MAJOR")] + OsMajor, + [EnumMember(Value = "OS")] + Os, + [EnumMember(Value = "NAME")] + Name, + [EnumMember(Value = "MINOR")] + Minor, + [EnumMember(Value = "MAJOR")] + Major, + [EnumMember(Value = "DEVICE")] + Device, + [EnumMember(Value = "BUILD")] + Build +} + +internal sealed class UserAgentPropertyConverter : JsonConverter +{ + public override UserAgentProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "PATCH": + return UserAgentProperty.Patch; + case "OS_NAME": + return UserAgentProperty.OsName; + case "OS_MINOR": + return UserAgentProperty.OsMinor; + case "OS_MAJOR": + return UserAgentProperty.OsMajor; + case "OS": + return UserAgentProperty.Os; + case "NAME": + return UserAgentProperty.Name; + case "MINOR": + return UserAgentProperty.Minor; + case "MAJOR": + return UserAgentProperty.Major; + case "DEVICE": + return UserAgentProperty.Device; + case "BUILD": + return UserAgentProperty.Build; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, UserAgentProperty value, JsonSerializerOptions options) + { + switch (value) + { + case UserAgentProperty.Patch: + writer.WriteStringValue("PATCH"); + return; + case UserAgentProperty.OsName: + writer.WriteStringValue("OS_NAME"); + return; + case UserAgentProperty.OsMinor: + writer.WriteStringValue("OS_MINOR"); + return; + case UserAgentProperty.OsMajor: + writer.WriteStringValue("OS_MAJOR"); + return; + case UserAgentProperty.Os: + writer.WriteStringValue("OS"); + return; + case UserAgentProperty.Name: + writer.WriteStringValue("NAME"); + return; + case UserAgentProperty.Minor: + writer.WriteStringValue("MINOR"); + return; + case UserAgentProperty.Major: + writer.WriteStringValue("MAJOR"); + return; + case UserAgentProperty.Device: + writer.WriteStringValue("DEVICE"); + return; + case UserAgentProperty.Build: + writer.WriteStringValue("BUILD"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs new file mode 100644 index 00000000000..b0740fba797 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs @@ -0,0 +1,902 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +[JsonConverter(typeof(DynamicMappingConverter))] +public enum DynamicMapping +{ + [EnumMember(Value = "true")] + True, + [EnumMember(Value = "strict")] + Strict, + [EnumMember(Value = "runtime")] + Runtime, + [EnumMember(Value = "false")] + False +} + +internal sealed class DynamicMappingConverter : JsonConverter +{ + public override DynamicMapping Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "true": + return DynamicMapping.True; + case "strict": + return DynamicMapping.Strict; + case "runtime": + return DynamicMapping.Runtime; + case "false": + return DynamicMapping.False; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DynamicMapping value, JsonSerializerOptions options) + { + switch (value) + { + case DynamicMapping.True: + writer.WriteStringValue("true"); + return; + case DynamicMapping.Strict: + writer.WriteStringValue("strict"); + return; + case DynamicMapping.Runtime: + writer.WriteStringValue("runtime"); + return; + case DynamicMapping.False: + writer.WriteStringValue("false"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FieldTypeConverter))] +public enum FieldType +{ + [EnumMember(Value = "token_count")] + TokenCount, + [EnumMember(Value = "text")] + Text, + [EnumMember(Value = "short")] + Short, + [EnumMember(Value = "shape")] + Shape, + [EnumMember(Value = "search_as_you_type")] + SearchAsYouType, + [EnumMember(Value = "scaled_float")] + ScaledFloat, + [EnumMember(Value = "rank_features")] + RankFeatures, + [EnumMember(Value = "rank_feature")] + RankFeature, + [EnumMember(Value = "percolator")] + Percolator, + [EnumMember(Value = "object")] + Object, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "nested")] + Nested, + [EnumMember(Value = "murmur3")] + Murmur3, + [EnumMember(Value = "match_only_text")] + MatchOnlyText, + [EnumMember(Value = "long_range")] + LongRange, + [EnumMember(Value = "long")] + Long, + [EnumMember(Value = "keyword")] + Keyword, + [EnumMember(Value = "join")] + Join, + [EnumMember(Value = "ip_range")] + IpRange, + [EnumMember(Value = "ip")] + Ip, + [EnumMember(Value = "integer_range")] + IntegerRange, + [EnumMember(Value = "integer")] + Integer, + [EnumMember(Value = "histogram")] + Histogram, + [EnumMember(Value = "half_float")] + HalfFloat, + [EnumMember(Value = "geo_shape")] + GeoShape, + [EnumMember(Value = "geo_point")] + GeoPoint, + [EnumMember(Value = "float_range")] + FloatRange, + [EnumMember(Value = "float")] + Float, + [EnumMember(Value = "flattened")] + Flattened, + [EnumMember(Value = "double_range")] + DoubleRange, + [EnumMember(Value = "double")] + Double, + [EnumMember(Value = "dense_vector")] + DenseVector, + [EnumMember(Value = "date_range")] + DateRange, + [EnumMember(Value = "date_nanos")] + DateNanos, + [EnumMember(Value = "date")] + Date, + [EnumMember(Value = "constant_keyword")] + ConstantKeyword, + [EnumMember(Value = "completion")] + Completion, + [EnumMember(Value = "byte")] + Byte, + [EnumMember(Value = "boolean")] + Boolean, + [EnumMember(Value = "binary")] + Binary, + [EnumMember(Value = "alias")] + Alias, + [EnumMember(Value = "aggregate_metric_double")] + AggregateMetricDouble +} + +internal sealed class FieldTypeConverter : JsonConverter +{ + public override FieldType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "token_count": + return FieldType.TokenCount; + case "text": + return FieldType.Text; + case "short": + return FieldType.Short; + case "shape": + return FieldType.Shape; + case "search_as_you_type": + return FieldType.SearchAsYouType; + case "scaled_float": + return FieldType.ScaledFloat; + case "rank_features": + return FieldType.RankFeatures; + case "rank_feature": + return FieldType.RankFeature; + case "percolator": + return FieldType.Percolator; + case "object": + return FieldType.Object; + case "none": + return FieldType.None; + case "nested": + return FieldType.Nested; + case "murmur3": + return FieldType.Murmur3; + case "match_only_text": + return FieldType.MatchOnlyText; + case "long_range": + return FieldType.LongRange; + case "long": + return FieldType.Long; + case "keyword": + return FieldType.Keyword; + case "join": + return FieldType.Join; + case "ip_range": + return FieldType.IpRange; + case "ip": + return FieldType.Ip; + case "integer_range": + return FieldType.IntegerRange; + case "integer": + return FieldType.Integer; + case "histogram": + return FieldType.Histogram; + case "half_float": + return FieldType.HalfFloat; + case "geo_shape": + return FieldType.GeoShape; + case "geo_point": + return FieldType.GeoPoint; + case "float_range": + return FieldType.FloatRange; + case "float": + return FieldType.Float; + case "flattened": + return FieldType.Flattened; + case "double_range": + return FieldType.DoubleRange; + case "double": + return FieldType.Double; + case "dense_vector": + return FieldType.DenseVector; + case "date_range": + return FieldType.DateRange; + case "date_nanos": + return FieldType.DateNanos; + case "date": + return FieldType.Date; + case "constant_keyword": + return FieldType.ConstantKeyword; + case "completion": + return FieldType.Completion; + case "byte": + return FieldType.Byte; + case "boolean": + return FieldType.Boolean; + case "binary": + return FieldType.Binary; + case "alias": + return FieldType.Alias; + case "aggregate_metric_double": + return FieldType.AggregateMetricDouble; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, FieldType value, JsonSerializerOptions options) + { + switch (value) + { + case FieldType.TokenCount: + writer.WriteStringValue("token_count"); + return; + case FieldType.Text: + writer.WriteStringValue("text"); + return; + case FieldType.Short: + writer.WriteStringValue("short"); + return; + case FieldType.Shape: + writer.WriteStringValue("shape"); + return; + case FieldType.SearchAsYouType: + writer.WriteStringValue("search_as_you_type"); + return; + case FieldType.ScaledFloat: + writer.WriteStringValue("scaled_float"); + return; + case FieldType.RankFeatures: + writer.WriteStringValue("rank_features"); + return; + case FieldType.RankFeature: + writer.WriteStringValue("rank_feature"); + return; + case FieldType.Percolator: + writer.WriteStringValue("percolator"); + return; + case FieldType.Object: + writer.WriteStringValue("object"); + return; + case FieldType.None: + writer.WriteStringValue("none"); + return; + case FieldType.Nested: + writer.WriteStringValue("nested"); + return; + case FieldType.Murmur3: + writer.WriteStringValue("murmur3"); + return; + case FieldType.MatchOnlyText: + writer.WriteStringValue("match_only_text"); + return; + case FieldType.LongRange: + writer.WriteStringValue("long_range"); + return; + case FieldType.Long: + writer.WriteStringValue("long"); + return; + case FieldType.Keyword: + writer.WriteStringValue("keyword"); + return; + case FieldType.Join: + writer.WriteStringValue("join"); + return; + case FieldType.IpRange: + writer.WriteStringValue("ip_range"); + return; + case FieldType.Ip: + writer.WriteStringValue("ip"); + return; + case FieldType.IntegerRange: + writer.WriteStringValue("integer_range"); + return; + case FieldType.Integer: + writer.WriteStringValue("integer"); + return; + case FieldType.Histogram: + writer.WriteStringValue("histogram"); + return; + case FieldType.HalfFloat: + writer.WriteStringValue("half_float"); + return; + case FieldType.GeoShape: + writer.WriteStringValue("geo_shape"); + return; + case FieldType.GeoPoint: + writer.WriteStringValue("geo_point"); + return; + case FieldType.FloatRange: + writer.WriteStringValue("float_range"); + return; + case FieldType.Float: + writer.WriteStringValue("float"); + return; + case FieldType.Flattened: + writer.WriteStringValue("flattened"); + return; + case FieldType.DoubleRange: + writer.WriteStringValue("double_range"); + return; + case FieldType.Double: + writer.WriteStringValue("double"); + return; + case FieldType.DenseVector: + writer.WriteStringValue("dense_vector"); + return; + case FieldType.DateRange: + writer.WriteStringValue("date_range"); + return; + case FieldType.DateNanos: + writer.WriteStringValue("date_nanos"); + return; + case FieldType.Date: + writer.WriteStringValue("date"); + return; + case FieldType.ConstantKeyword: + writer.WriteStringValue("constant_keyword"); + return; + case FieldType.Completion: + writer.WriteStringValue("completion"); + return; + case FieldType.Byte: + writer.WriteStringValue("byte"); + return; + case FieldType.Boolean: + writer.WriteStringValue("boolean"); + return; + case FieldType.Binary: + writer.WriteStringValue("binary"); + return; + case FieldType.Alias: + writer.WriteStringValue("alias"); + return; + case FieldType.AggregateMetricDouble: + writer.WriteStringValue("aggregate_metric_double"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GeoOrientationConverter))] +public enum GeoOrientation +{ + [EnumMember(Value = "right")] + Right, + [EnumMember(Value = "left")] + Left +} + +internal sealed class GeoOrientationConverter : JsonConverter +{ + public override GeoOrientation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "right": + case "RIGHT": + case "counterclockwise": + case "ccw": + return GeoOrientation.Right; + case "left": + case "LEFT": + case "clockwise": + case "cw": + return GeoOrientation.Left; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GeoOrientation value, JsonSerializerOptions options) + { + switch (value) + { + case GeoOrientation.Right: + writer.WriteStringValue("right"); + return; + case GeoOrientation.Left: + writer.WriteStringValue("left"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GeoStrategyConverter))] +public enum GeoStrategy +{ + [EnumMember(Value = "term")] + Term, + [EnumMember(Value = "recursive")] + Recursive +} + +internal sealed class GeoStrategyConverter : JsonConverter +{ + public override GeoStrategy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "term": + return GeoStrategy.Term; + case "recursive": + return GeoStrategy.Recursive; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GeoStrategy value, JsonSerializerOptions options) + { + switch (value) + { + case GeoStrategy.Term: + writer.WriteStringValue("term"); + return; + case GeoStrategy.Recursive: + writer.WriteStringValue("recursive"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndexOptionsConverter))] +public enum IndexOptions +{ + [EnumMember(Value = "positions")] + Positions, + [EnumMember(Value = "offsets")] + Offsets, + [EnumMember(Value = "freqs")] + Freqs, + [EnumMember(Value = "docs")] + Docs +} + +internal sealed class IndexOptionsConverter : JsonConverter +{ + public override IndexOptions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "positions": + return IndexOptions.Positions; + case "offsets": + return IndexOptions.Offsets; + case "freqs": + return IndexOptions.Freqs; + case "docs": + return IndexOptions.Docs; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IndexOptions value, JsonSerializerOptions options) + { + switch (value) + { + case IndexOptions.Positions: + writer.WriteStringValue("positions"); + return; + case IndexOptions.Offsets: + writer.WriteStringValue("offsets"); + return; + case IndexOptions.Freqs: + writer.WriteStringValue("freqs"); + return; + case IndexOptions.Docs: + writer.WriteStringValue("docs"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MatchTypeConverter))] +public enum MatchType +{ + [EnumMember(Value = "simple")] + Simple, + [EnumMember(Value = "regex")] + Regex +} + +internal sealed class MatchTypeConverter : JsonConverter +{ + public override MatchType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "simple": + return MatchType.Simple; + case "regex": + return MatchType.Regex; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, MatchType value, JsonSerializerOptions options) + { + switch (value) + { + case MatchType.Simple: + writer.WriteStringValue("simple"); + return; + case MatchType.Regex: + writer.WriteStringValue("regex"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(OnScriptErrorConverter))] +public enum OnScriptError +{ + [EnumMember(Value = "fail")] + Fail, + [EnumMember(Value = "continue")] + Continue +} + +internal sealed class OnScriptErrorConverter : JsonConverter +{ + public override OnScriptError Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "fail": + return OnScriptError.Fail; + case "continue": + return OnScriptError.Continue; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, OnScriptError value, JsonSerializerOptions options) + { + switch (value) + { + case OnScriptError.Fail: + writer.WriteStringValue("fail"); + return; + case OnScriptError.Continue: + writer.WriteStringValue("continue"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RuntimeFieldTypeConverter))] +public enum RuntimeFieldType +{ + [EnumMember(Value = "lookup")] + Lookup, + [EnumMember(Value = "long")] + Long, + [EnumMember(Value = "keyword")] + Keyword, + [EnumMember(Value = "ip")] + Ip, + [EnumMember(Value = "geo_point")] + GeoPoint, + [EnumMember(Value = "double")] + Double, + [EnumMember(Value = "date")] + Date, + [EnumMember(Value = "boolean")] + Boolean +} + +internal sealed class RuntimeFieldTypeConverter : JsonConverter +{ + public override RuntimeFieldType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "lookup": + return RuntimeFieldType.Lookup; + case "long": + return RuntimeFieldType.Long; + case "keyword": + return RuntimeFieldType.Keyword; + case "ip": + return RuntimeFieldType.Ip; + case "geo_point": + return RuntimeFieldType.GeoPoint; + case "double": + return RuntimeFieldType.Double; + case "date": + return RuntimeFieldType.Date; + case "boolean": + return RuntimeFieldType.Boolean; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, RuntimeFieldType value, JsonSerializerOptions options) + { + switch (value) + { + case RuntimeFieldType.Lookup: + writer.WriteStringValue("lookup"); + return; + case RuntimeFieldType.Long: + writer.WriteStringValue("long"); + return; + case RuntimeFieldType.Keyword: + writer.WriteStringValue("keyword"); + return; + case RuntimeFieldType.Ip: + writer.WriteStringValue("ip"); + return; + case RuntimeFieldType.GeoPoint: + writer.WriteStringValue("geo_point"); + return; + case RuntimeFieldType.Double: + writer.WriteStringValue("double"); + return; + case RuntimeFieldType.Date: + writer.WriteStringValue("date"); + return; + case RuntimeFieldType.Boolean: + writer.WriteStringValue("boolean"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SourceFieldModeConverter))] +public enum SourceFieldMode +{ + /// + /// Instead of storing source documents on disk exactly as you send them,
Elasticsearch can reconstruct source content on the fly upon retrieval.
+ ///
+ [EnumMember(Value = "synthetic")] + Synthetic, + [EnumMember(Value = "stored")] + Stored, + [EnumMember(Value = "disabled")] + Disabled +} + +internal sealed class SourceFieldModeConverter : JsonConverter +{ + public override SourceFieldMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "synthetic": + return SourceFieldMode.Synthetic; + case "stored": + return SourceFieldMode.Stored; + case "disabled": + return SourceFieldMode.Disabled; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SourceFieldMode value, JsonSerializerOptions options) + { + switch (value) + { + case SourceFieldMode.Synthetic: + writer.WriteStringValue("synthetic"); + return; + case SourceFieldMode.Stored: + writer.WriteStringValue("stored"); + return; + case SourceFieldMode.Disabled: + writer.WriteStringValue("disabled"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TermVectorOptionConverter))] +public enum TermVectorOption +{ + [EnumMember(Value = "yes")] + Yes, + [EnumMember(Value = "with_positions_payloads")] + WithPositionsPayloads, + [EnumMember(Value = "with_positions_offsets_payloads")] + WithPositionsOffsetsPayloads, + [EnumMember(Value = "with_positions_offsets")] + WithPositionsOffsets, + [EnumMember(Value = "with_positions")] + WithPositions, + [EnumMember(Value = "with_offsets")] + WithOffsets, + [EnumMember(Value = "no")] + No +} + +internal sealed class TermVectorOptionConverter : JsonConverter +{ + public override TermVectorOption Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yes": + return TermVectorOption.Yes; + case "with_positions_payloads": + return TermVectorOption.WithPositionsPayloads; + case "with_positions_offsets_payloads": + return TermVectorOption.WithPositionsOffsetsPayloads; + case "with_positions_offsets": + return TermVectorOption.WithPositionsOffsets; + case "with_positions": + return TermVectorOption.WithPositions; + case "with_offsets": + return TermVectorOption.WithOffsets; + case "no": + return TermVectorOption.No; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TermVectorOption value, JsonSerializerOptions options) + { + switch (value) + { + case TermVectorOption.Yes: + writer.WriteStringValue("yes"); + return; + case TermVectorOption.WithPositionsPayloads: + writer.WriteStringValue("with_positions_payloads"); + return; + case TermVectorOption.WithPositionsOffsetsPayloads: + writer.WriteStringValue("with_positions_offsets_payloads"); + return; + case TermVectorOption.WithPositionsOffsets: + writer.WriteStringValue("with_positions_offsets"); + return; + case TermVectorOption.WithPositions: + writer.WriteStringValue("with_positions"); + return; + case TermVectorOption.WithOffsets: + writer.WriteStringValue("with_offsets"); + return; + case TermVectorOption.No: + writer.WriteStringValue("no"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TimeSeriesMetricTypeConverter))] +public enum TimeSeriesMetricType +{ + [EnumMember(Value = "summary")] + Summary, + [EnumMember(Value = "position")] + Position, + [EnumMember(Value = "histogram")] + Histogram, + [EnumMember(Value = "gauge")] + Gauge, + [EnumMember(Value = "counter")] + Counter +} + +internal sealed class TimeSeriesMetricTypeConverter : JsonConverter +{ + public override TimeSeriesMetricType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "summary": + return TimeSeriesMetricType.Summary; + case "position": + return TimeSeriesMetricType.Position; + case "histogram": + return TimeSeriesMetricType.Histogram; + case "gauge": + return TimeSeriesMetricType.Gauge; + case "counter": + return TimeSeriesMetricType.Counter; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TimeSeriesMetricType value, JsonSerializerOptions options) + { + switch (value) + { + case TimeSeriesMetricType.Summary: + writer.WriteStringValue("summary"); + return; + case TimeSeriesMetricType.Position: + writer.WriteStringValue("position"); + return; + case TimeSeriesMetricType.Histogram: + writer.WriteStringValue("histogram"); + return; + case TimeSeriesMetricType.Gauge: + writer.WriteStringValue("gauge"); + return; + case TimeSeriesMetricType.Counter: + writer.WriteStringValue("counter"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs new file mode 100644 index 00000000000..bd5061fb692 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs @@ -0,0 +1,77 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +[JsonConverter(typeof(TokenizationTruncateConverter))] +public enum TokenizationTruncate +{ + [EnumMember(Value = "second")] + Second, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "first")] + First +} + +internal sealed class TokenizationTruncateConverter : JsonConverter +{ + public override TokenizationTruncate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "second": + return TokenizationTruncate.Second; + case "none": + return TokenizationTruncate.None; + case "first": + return TokenizationTruncate.First; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TokenizationTruncate value, JsonSerializerOptions options) + { + switch (value) + { + case TokenizationTruncate.Second: + writer.WriteStringValue("second"); + return; + case TokenizationTruncate.None: + writer.WriteStringValue("none"); + return; + case TokenizationTruncate.First: + writer.WriteStringValue("first"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.NoNamespace.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.NoNamespace.g.cs new file mode 100644 index 00000000000..3ae3ea0d3fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.NoNamespace.g.cs @@ -0,0 +1,1485 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +[JsonConverter(typeof(ClusterSearchStatusConverter))] +public enum ClusterSearchStatus +{ + [EnumMember(Value = "successful")] + Successful, + [EnumMember(Value = "skipped")] + Skipped, + [EnumMember(Value = "running")] + Running, + [EnumMember(Value = "partial")] + Partial, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class ClusterSearchStatusConverter : JsonConverter +{ + public override ClusterSearchStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "successful": + return ClusterSearchStatus.Successful; + case "skipped": + return ClusterSearchStatus.Skipped; + case "running": + return ClusterSearchStatus.Running; + case "partial": + return ClusterSearchStatus.Partial; + case "failed": + return ClusterSearchStatus.Failed; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ClusterSearchStatus value, JsonSerializerOptions options) + { + switch (value) + { + case ClusterSearchStatus.Successful: + writer.WriteStringValue("successful"); + return; + case ClusterSearchStatus.Skipped: + writer.WriteStringValue("skipped"); + return; + case ClusterSearchStatus.Running: + writer.WriteStringValue("running"); + return; + case ClusterSearchStatus.Partial: + writer.WriteStringValue("partial"); + return; + case ClusterSearchStatus.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ConflictsConverter))] +public enum Conflicts +{ + [EnumMember(Value = "proceed")] + Proceed, + [EnumMember(Value = "abort")] + Abort +} + +internal sealed class ConflictsConverter : JsonConverter +{ + public override Conflicts Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "proceed": + return Conflicts.Proceed; + case "abort": + return Conflicts.Abort; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Conflicts value, JsonSerializerOptions options) + { + switch (value) + { + case Conflicts.Proceed: + writer.WriteStringValue("proceed"); + return; + case Conflicts.Abort: + writer.WriteStringValue("abort"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DFIIndependenceMeasureConverter))] +public enum DFIIndependenceMeasure +{ + [EnumMember(Value = "standardized")] + Standardized, + [EnumMember(Value = "saturated")] + Saturated, + [EnumMember(Value = "chisquared")] + Chisquared +} + +internal sealed class DFIIndependenceMeasureConverter : JsonConverter +{ + public override DFIIndependenceMeasure Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "standardized": + return DFIIndependenceMeasure.Standardized; + case "saturated": + return DFIIndependenceMeasure.Saturated; + case "chisquared": + return DFIIndependenceMeasure.Chisquared; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DFIIndependenceMeasure value, JsonSerializerOptions options) + { + switch (value) + { + case DFIIndependenceMeasure.Standardized: + writer.WriteStringValue("standardized"); + return; + case DFIIndependenceMeasure.Saturated: + writer.WriteStringValue("saturated"); + return; + case DFIIndependenceMeasure.Chisquared: + writer.WriteStringValue("chisquared"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DFRAfterEffectConverter))] +public enum DFRAfterEffect +{ + [EnumMember(Value = "no")] + No, + [EnumMember(Value = "l")] + l, + [EnumMember(Value = "b")] + b +} + +internal sealed class DFRAfterEffectConverter : JsonConverter +{ + public override DFRAfterEffect Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "no": + return DFRAfterEffect.No; + case "l": + return DFRAfterEffect.l; + case "b": + return DFRAfterEffect.b; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DFRAfterEffect value, JsonSerializerOptions options) + { + switch (value) + { + case DFRAfterEffect.No: + writer.WriteStringValue("no"); + return; + case DFRAfterEffect.l: + writer.WriteStringValue("l"); + return; + case DFRAfterEffect.b: + writer.WriteStringValue("b"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DFRBasicModelConverter))] +public enum DFRBasicModel +{ + [EnumMember(Value = "p")] + p, + [EnumMember(Value = "ine")] + Ine, + [EnumMember(Value = "in")] + In, + [EnumMember(Value = "if")] + If, + [EnumMember(Value = "g")] + g, + [EnumMember(Value = "d")] + d, + [EnumMember(Value = "be")] + Be +} + +internal sealed class DFRBasicModelConverter : JsonConverter +{ + public override DFRBasicModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "p": + return DFRBasicModel.p; + case "ine": + return DFRBasicModel.Ine; + case "in": + return DFRBasicModel.In; + case "if": + return DFRBasicModel.If; + case "g": + return DFRBasicModel.g; + case "d": + return DFRBasicModel.d; + case "be": + return DFRBasicModel.Be; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DFRBasicModel value, JsonSerializerOptions options) + { + switch (value) + { + case DFRBasicModel.p: + writer.WriteStringValue("p"); + return; + case DFRBasicModel.Ine: + writer.WriteStringValue("ine"); + return; + case DFRBasicModel.In: + writer.WriteStringValue("in"); + return; + case DFRBasicModel.If: + writer.WriteStringValue("if"); + return; + case DFRBasicModel.g: + writer.WriteStringValue("g"); + return; + case DFRBasicModel.d: + writer.WriteStringValue("d"); + return; + case DFRBasicModel.Be: + writer.WriteStringValue("be"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DistanceUnitConverter))] +public enum DistanceUnit +{ + [EnumMember(Value = "yd")] + Yards, + [EnumMember(Value = "nmi")] + NauticMiles, + [EnumMember(Value = "mm")] + Millimeters, + [EnumMember(Value = "mi")] + Miles, + [EnumMember(Value = "m")] + Meters, + [EnumMember(Value = "km")] + Kilometers, + [EnumMember(Value = "in")] + Inches, + [EnumMember(Value = "ft")] + Feet, + [EnumMember(Value = "cm")] + Centimeters +} + +internal sealed class DistanceUnitConverter : JsonConverter +{ + public override DistanceUnit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yd": + return DistanceUnit.Yards; + case "nmi": + return DistanceUnit.NauticMiles; + case "mm": + return DistanceUnit.Millimeters; + case "mi": + return DistanceUnit.Miles; + case "m": + return DistanceUnit.Meters; + case "km": + return DistanceUnit.Kilometers; + case "in": + return DistanceUnit.Inches; + case "ft": + return DistanceUnit.Feet; + case "cm": + return DistanceUnit.Centimeters; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, DistanceUnit value, JsonSerializerOptions options) + { + switch (value) + { + case DistanceUnit.Yards: + writer.WriteStringValue("yd"); + return; + case DistanceUnit.NauticMiles: + writer.WriteStringValue("nmi"); + return; + case DistanceUnit.Millimeters: + writer.WriteStringValue("mm"); + return; + case DistanceUnit.Miles: + writer.WriteStringValue("mi"); + return; + case DistanceUnit.Meters: + writer.WriteStringValue("m"); + return; + case DistanceUnit.Kilometers: + writer.WriteStringValue("km"); + return; + case DistanceUnit.Inches: + writer.WriteStringValue("in"); + return; + case DistanceUnit.Feet: + writer.WriteStringValue("ft"); + return; + case DistanceUnit.Centimeters: + writer.WriteStringValue("cm"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ExpandWildcardConverter))] +public enum ExpandWildcard +{ + /// + /// Match open, non-hidden indices. Also matches any non-hidden data stream. + /// + [EnumMember(Value = "open")] + Open, + /// + /// Wildcard expressions are not accepted. + /// + [EnumMember(Value = "none")] + None, + /// + /// Match hidden data streams and hidden indices. Must be combined with open, closed, or both. + /// + [EnumMember(Value = "hidden")] + Hidden, + /// + /// Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. + /// + [EnumMember(Value = "closed")] + Closed, + /// + /// Match any data stream or index, including hidden ones. + /// + [EnumMember(Value = "all")] + All +} + +internal sealed class ExpandWildcardConverter : JsonConverter +{ + public override ExpandWildcard Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "open": + return ExpandWildcard.Open; + case "none": + return ExpandWildcard.None; + case "hidden": + return ExpandWildcard.Hidden; + case "closed": + return ExpandWildcard.Closed; + case "all": + return ExpandWildcard.All; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ExpandWildcard value, JsonSerializerOptions options) + { + switch (value) + { + case ExpandWildcard.Open: + writer.WriteStringValue("open"); + return; + case ExpandWildcard.None: + writer.WriteStringValue("none"); + return; + case ExpandWildcard.Hidden: + writer.WriteStringValue("hidden"); + return; + case ExpandWildcard.Closed: + writer.WriteStringValue("closed"); + return; + case ExpandWildcard.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FieldSortNumericTypeConverter))] +public enum FieldSortNumericType +{ + [EnumMember(Value = "long")] + Long, + [EnumMember(Value = "double")] + Double, + [EnumMember(Value = "date_nanos")] + DateNanos, + [EnumMember(Value = "date")] + Date +} + +internal sealed class FieldSortNumericTypeConverter : JsonConverter +{ + public override FieldSortNumericType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "long": + return FieldSortNumericType.Long; + case "double": + return FieldSortNumericType.Double; + case "date_nanos": + return FieldSortNumericType.DateNanos; + case "date": + return FieldSortNumericType.Date; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, FieldSortNumericType value, JsonSerializerOptions options) + { + switch (value) + { + case FieldSortNumericType.Long: + writer.WriteStringValue("long"); + return; + case FieldSortNumericType.Double: + writer.WriteStringValue("double"); + return; + case FieldSortNumericType.DateNanos: + writer.WriteStringValue("date_nanos"); + return; + case FieldSortNumericType.Date: + writer.WriteStringValue("date"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GeoDistanceTypeConverter))] +public enum GeoDistanceType +{ + /// + /// The `plane` calculation is faster but less accurate. + /// + [EnumMember(Value = "plane")] + Plane, + /// + /// The `arc` calculation is the most accurate. + /// + [EnumMember(Value = "arc")] + Arc +} + +internal sealed class GeoDistanceTypeConverter : JsonConverter +{ + public override GeoDistanceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "plane": + return GeoDistanceType.Plane; + case "arc": + return GeoDistanceType.Arc; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GeoDistanceType value, JsonSerializerOptions options) + { + switch (value) + { + case GeoDistanceType.Plane: + writer.WriteStringValue("plane"); + return; + case GeoDistanceType.Arc: + writer.WriteStringValue("arc"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GeoShapeRelationConverter))] +public enum GeoShapeRelation +{ + /// + /// Return all documents whose `geo_shape` or `geo_point` field is within the query geometry.
Line geometries are not supported.
+ ///
+ [EnumMember(Value = "within")] + Within, + /// + /// Return all documents whose `geo_shape` or `geo_point` field intersects the query geometry. + /// + [EnumMember(Value = "intersects")] + Intersects, + /// + /// Return all documents whose `geo_shape` or `geo_point` field has nothing in common with the query geometry. + /// + [EnumMember(Value = "disjoint")] + Disjoint, + /// + /// Return all documents whose `geo_shape` or `geo_point` field contains the query geometry. + /// + [EnumMember(Value = "contains")] + Contains +} + +internal sealed class GeoShapeRelationConverter : JsonConverter +{ + public override GeoShapeRelation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "within": + return GeoShapeRelation.Within; + case "intersects": + return GeoShapeRelation.Intersects; + case "disjoint": + return GeoShapeRelation.Disjoint; + case "contains": + return GeoShapeRelation.Contains; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GeoShapeRelation value, JsonSerializerOptions options) + { + switch (value) + { + case GeoShapeRelation.Within: + writer.WriteStringValue("within"); + return; + case GeoShapeRelation.Intersects: + writer.WriteStringValue("intersects"); + return; + case GeoShapeRelation.Disjoint: + writer.WriteStringValue("disjoint"); + return; + case GeoShapeRelation.Contains: + writer.WriteStringValue("contains"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(HealthStatusConverter))] +public enum HealthStatus +{ + /// + /// 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. + /// + [EnumMember(Value = "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. + /// + [EnumMember(Value = "red")] + Red, + /// + /// All shards are assigned. + /// + [EnumMember(Value = "green")] + Green +} + +internal sealed class HealthStatusConverter : JsonConverter +{ + public override HealthStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yellow": + case "YELLOW": + return HealthStatus.Yellow; + case "red": + case "RED": + return HealthStatus.Red; + case "green": + case "GREEN": + return HealthStatus.Green; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, HealthStatus value, JsonSerializerOptions options) + { + switch (value) + { + case HealthStatus.Yellow: + writer.WriteStringValue("yellow"); + return; + case HealthStatus.Red: + writer.WriteStringValue("red"); + return; + case HealthStatus.Green: + writer.WriteStringValue("green"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IBDistributionConverter))] +public enum IBDistribution +{ + [EnumMember(Value = "spl")] + Spl, + [EnumMember(Value = "ll")] + Ll +} + +internal sealed class IBDistributionConverter : JsonConverter +{ + public override IBDistribution Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "spl": + return IBDistribution.Spl; + case "ll": + return IBDistribution.Ll; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IBDistribution value, JsonSerializerOptions options) + { + switch (value) + { + case IBDistribution.Spl: + writer.WriteStringValue("spl"); + return; + case IBDistribution.Ll: + writer.WriteStringValue("ll"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IBLambdaConverter))] +public enum IBLambda +{ + [EnumMember(Value = "ttf")] + Ttf, + [EnumMember(Value = "df")] + Df +} + +internal sealed class IBLambdaConverter : JsonConverter +{ + public override IBLambda Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "ttf": + return IBLambda.Ttf; + case "df": + return IBLambda.Df; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, IBLambda value, JsonSerializerOptions options) + { + switch (value) + { + case IBLambda.Ttf: + writer.WriteStringValue("ttf"); + return; + case IBLambda.Df: + writer.WriteStringValue("df"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(LevelConverter))] +public enum Level +{ + [EnumMember(Value = "shards")] + Shards, + [EnumMember(Value = "indices")] + Indices, + [EnumMember(Value = "cluster")] + Cluster +} + +internal sealed class LevelConverter : JsonConverter +{ + public override Level Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "shards": + return Level.Shards; + case "indices": + return Level.Indices; + case "cluster": + return Level.Cluster; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Level value, JsonSerializerOptions options) + { + switch (value) + { + case Level.Shards: + writer.WriteStringValue("shards"); + return; + case Level.Indices: + writer.WriteStringValue("indices"); + return; + case Level.Cluster: + writer.WriteStringValue("cluster"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(NormalizationConverter))] +public enum Normalization +{ + [EnumMember(Value = "z")] + z, + [EnumMember(Value = "no")] + No, + [EnumMember(Value = "h3")] + H3, + [EnumMember(Value = "h2")] + H2, + [EnumMember(Value = "h1")] + H1 +} + +internal sealed class NormalizationConverter : JsonConverter +{ + public override Normalization Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "z": + return Normalization.z; + case "no": + return Normalization.No; + case "h3": + return Normalization.H3; + case "h2": + return Normalization.H2; + case "h1": + return Normalization.H1; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Normalization value, JsonSerializerOptions options) + { + switch (value) + { + case Normalization.z: + writer.WriteStringValue("z"); + return; + case Normalization.No: + writer.WriteStringValue("no"); + return; + case Normalization.H3: + writer.WriteStringValue("h3"); + return; + case Normalization.H2: + writer.WriteStringValue("h2"); + return; + case Normalization.H1: + writer.WriteStringValue("h1"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ResultConverter))] +public enum Result +{ + [EnumMember(Value = "updated")] + Updated, + [EnumMember(Value = "not_found")] + NotFound, + [EnumMember(Value = "noop")] + NoOp, + [EnumMember(Value = "deleted")] + Deleted, + [EnumMember(Value = "created")] + Created +} + +internal sealed class ResultConverter : JsonConverter +{ + public override Result Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "updated": + return Result.Updated; + case "not_found": + return Result.NotFound; + case "noop": + return Result.NoOp; + case "deleted": + return Result.Deleted; + case "created": + return Result.Created; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) + { + switch (value) + { + case Result.Updated: + writer.WriteStringValue("updated"); + return; + case Result.NotFound: + writer.WriteStringValue("not_found"); + return; + case Result.NoOp: + writer.WriteStringValue("noop"); + return; + case Result.Deleted: + writer.WriteStringValue("deleted"); + return; + case Result.Created: + writer.WriteStringValue("created"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(EnumStructConverter))] +public readonly partial struct ScriptLanguage : IEnumStruct +{ + public ScriptLanguage(string value) => Value = value; + + ScriptLanguage IEnumStruct.Create(string value) => value; + + public readonly string Value { get; } + + /// + /// Painless scripting language, purpose-built for Elasticsearch. + /// + public static ScriptLanguage Painless { get; } = new ScriptLanguage("painless"); + + /// + /// Mustache templated, used for templates. + /// + public static ScriptLanguage Mustache { get; } = new ScriptLanguage("mustache"); + + /// + /// Expert Java API + /// + public static ScriptLanguage Java { get; } = new ScriptLanguage("java"); + + /// + /// Lucene’s expressions language, compiles a JavaScript expression to bytecode. + /// + public static ScriptLanguage Expression { get; } = new ScriptLanguage("expression"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(ScriptLanguage scriptLanguage) => scriptLanguage.Value; + public static implicit operator ScriptLanguage(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is ScriptLanguage other && this.Equals(other); + public bool Equals(ScriptLanguage other) => Value == other.Value; + + public static bool operator ==(ScriptLanguage a, ScriptLanguage b) => a.Equals(b); + public static bool operator !=(ScriptLanguage a, ScriptLanguage b) => !(a == b); +} + +[JsonConverter(typeof(ScriptSortTypeConverter))] +public enum ScriptSortType +{ + [EnumMember(Value = "version")] + Version, + [EnumMember(Value = "string")] + String, + [EnumMember(Value = "number")] + Number +} + +internal sealed class ScriptSortTypeConverter : JsonConverter +{ + public override ScriptSortType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "version": + return ScriptSortType.Version; + case "string": + return ScriptSortType.String; + case "number": + return ScriptSortType.Number; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ScriptSortType value, JsonSerializerOptions options) + { + switch (value) + { + case ScriptSortType.Version: + writer.WriteStringValue("version"); + return; + case ScriptSortType.String: + writer.WriteStringValue("string"); + return; + case ScriptSortType.Number: + writer.WriteStringValue("number"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SearchTypeConverter))] +public enum SearchType +{ + /// + /// Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate. + /// + [EnumMember(Value = "query_then_fetch")] + QueryThenFetch, + /// + /// Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate. + /// + [EnumMember(Value = "dfs_query_then_fetch")] + DfsQueryThenFetch +} + +internal sealed class SearchTypeConverter : JsonConverter +{ + public override SearchType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "query_then_fetch": + return SearchType.QueryThenFetch; + case "dfs_query_then_fetch": + return SearchType.DfsQueryThenFetch; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SearchType value, JsonSerializerOptions options) + { + switch (value) + { + case SearchType.QueryThenFetch: + writer.WriteStringValue("query_then_fetch"); + return; + case SearchType.DfsQueryThenFetch: + writer.WriteStringValue("dfs_query_then_fetch"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SlicesCalculationConverter))] +public enum SlicesCalculation +{ + /// + /// Let Elasticsearch choose a reasonable number for most data streams and indices. + /// + [EnumMember(Value = "auto")] + Auto +} + +internal sealed class SlicesCalculationConverter : JsonConverter +{ + public override SlicesCalculation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "auto": + return SlicesCalculation.Auto; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SlicesCalculation value, JsonSerializerOptions options) + { + switch (value) + { + case SlicesCalculation.Auto: + writer.WriteStringValue("auto"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SortModeConverter))] +public enum SortMode +{ + [EnumMember(Value = "sum")] + Sum, + [EnumMember(Value = "min")] + Min, + [EnumMember(Value = "median")] + Median, + [EnumMember(Value = "max")] + Max, + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class SortModeConverter : JsonConverter +{ + public override SortMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return SortMode.Sum; + case "min": + return SortMode.Min; + case "median": + return SortMode.Median; + case "max": + return SortMode.Max; + case "avg": + return SortMode.Avg; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SortMode value, JsonSerializerOptions options) + { + switch (value) + { + case SortMode.Sum: + writer.WriteStringValue("sum"); + return; + case SortMode.Min: + writer.WriteStringValue("min"); + return; + case SortMode.Median: + writer.WriteStringValue("median"); + return; + case SortMode.Max: + writer.WriteStringValue("max"); + return; + case SortMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SortOrderConverter))] +public enum SortOrder +{ + /// + /// Descending (largest to smallest) + /// + [EnumMember(Value = "desc")] + Desc, + /// + /// Ascending (smallest to largest) + /// + [EnumMember(Value = "asc")] + Asc +} + +internal sealed class SortOrderConverter : JsonConverter +{ + public override SortOrder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "desc": + return SortOrder.Desc; + case "asc": + return SortOrder.Asc; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SortOrder value, JsonSerializerOptions options) + { + switch (value) + { + case SortOrder.Desc: + writer.WriteStringValue("desc"); + return; + case SortOrder.Asc: + writer.WriteStringValue("asc"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SuggestModeConverter))] +public enum SuggestMode +{ + [EnumMember(Value = "popular")] + Popular, + [EnumMember(Value = "missing")] + Missing, + [EnumMember(Value = "always")] + Always +} + +internal sealed class SuggestModeConverter : JsonConverter +{ + public override SuggestMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "popular": + return SuggestMode.Popular; + case "missing": + return SuggestMode.Missing; + case "always": + return SuggestMode.Always; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, SuggestMode value, JsonSerializerOptions options) + { + switch (value) + { + case SuggestMode.Popular: + writer.WriteStringValue("popular"); + return; + case SuggestMode.Missing: + writer.WriteStringValue("missing"); + return; + case SuggestMode.Always: + writer.WriteStringValue("always"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TimeUnitConverter))] +public enum TimeUnit +{ + [EnumMember(Value = "s")] + Seconds, + [EnumMember(Value = "nanos")] + Nanoseconds, + [EnumMember(Value = "ms")] + Milliseconds, + [EnumMember(Value = "micros")] + Microseconds, + [EnumMember(Value = "m")] + Minutes, + [EnumMember(Value = "h")] + Hours, + [EnumMember(Value = "d")] + Days +} + +internal sealed class TimeUnitConverter : JsonConverter +{ + public override TimeUnit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "s": + return TimeUnit.Seconds; + case "nanos": + return TimeUnit.Nanoseconds; + case "ms": + return TimeUnit.Milliseconds; + case "micros": + return TimeUnit.Microseconds; + case "m": + return TimeUnit.Minutes; + case "h": + return TimeUnit.Hours; + case "d": + return TimeUnit.Days; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TimeUnit value, JsonSerializerOptions options) + { + switch (value) + { + case TimeUnit.Seconds: + writer.WriteStringValue("s"); + return; + case TimeUnit.Nanoseconds: + writer.WriteStringValue("nanos"); + return; + case TimeUnit.Milliseconds: + writer.WriteStringValue("ms"); + return; + case TimeUnit.Microseconds: + writer.WriteStringValue("micros"); + return; + case TimeUnit.Minutes: + writer.WriteStringValue("m"); + return; + case TimeUnit.Hours: + writer.WriteStringValue("h"); + return; + case TimeUnit.Days: + writer.WriteStringValue("d"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(VersionTypeConverter))] +public enum VersionType +{ + [EnumMember(Value = "internal")] + Internal, + [EnumMember(Value = "force")] + Force, + [EnumMember(Value = "external_gte")] + ExternalGte, + [EnumMember(Value = "external")] + External +} + +internal sealed class VersionTypeConverter : JsonConverter +{ + public override VersionType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "internal": + return VersionType.Internal; + case "force": + return VersionType.Force; + case "external_gte": + return VersionType.ExternalGte; + case "external": + return VersionType.External; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, VersionType value, JsonSerializerOptions options) + { + switch (value) + { + case VersionType.Internal: + writer.WriteStringValue("internal"); + return; + case VersionType.Force: + writer.WriteStringValue("force"); + return; + case VersionType.ExternalGte: + writer.WriteStringValue("external_gte"); + return; + case VersionType.External: + writer.WriteStringValue("external"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(WaitForEventsConverter))] +public enum WaitForEvents +{ + [EnumMember(Value = "urgent")] + Urgent, + [EnumMember(Value = "normal")] + Normal, + [EnumMember(Value = "low")] + Low, + [EnumMember(Value = "languid")] + Languid, + [EnumMember(Value = "immediate")] + Immediate, + [EnumMember(Value = "high")] + High +} + +internal sealed class WaitForEventsConverter : JsonConverter +{ + public override WaitForEvents Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "urgent": + return WaitForEvents.Urgent; + case "normal": + return WaitForEvents.Normal; + case "low": + return WaitForEvents.Low; + case "languid": + return WaitForEvents.Languid; + case "immediate": + return WaitForEvents.Immediate; + case "high": + return WaitForEvents.High; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, WaitForEvents value, JsonSerializerOptions options) + { + switch (value) + { + case WaitForEvents.Urgent: + writer.WriteStringValue("urgent"); + return; + case WaitForEvents.Normal: + writer.WriteStringValue("normal"); + return; + case WaitForEvents.Low: + writer.WriteStringValue("low"); + return; + case WaitForEvents.Languid: + writer.WriteStringValue("languid"); + return; + case WaitForEvents.Immediate: + writer.WriteStringValue("immediate"); + return; + case WaitForEvents.High: + writer.WriteStringValue("high"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs new file mode 100644 index 00000000000..0a89dd2408e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs @@ -0,0 +1,921 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(ChildScoreModeConverter))] +public enum ChildScoreMode +{ + [EnumMember(Value = "sum")] + Sum, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "min")] + Min, + [EnumMember(Value = "max")] + Max, + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class ChildScoreModeConverter : JsonConverter +{ + public override ChildScoreMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return ChildScoreMode.Sum; + case "none": + return ChildScoreMode.None; + case "min": + return ChildScoreMode.Min; + case "max": + return ChildScoreMode.Max; + case "avg": + return ChildScoreMode.Avg; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ChildScoreMode value, JsonSerializerOptions options) + { + switch (value) + { + case ChildScoreMode.Sum: + writer.WriteStringValue("sum"); + return; + case ChildScoreMode.None: + writer.WriteStringValue("none"); + return; + case ChildScoreMode.Min: + writer.WriteStringValue("min"); + return; + case ChildScoreMode.Max: + writer.WriteStringValue("max"); + return; + case ChildScoreMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(CombinedFieldsOperatorConverter))] +public enum CombinedFieldsOperator +{ + [EnumMember(Value = "or")] + Or, + [EnumMember(Value = "and")] + And +} + +internal sealed class CombinedFieldsOperatorConverter : JsonConverter +{ + public override CombinedFieldsOperator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "or": + return CombinedFieldsOperator.Or; + case "and": + return CombinedFieldsOperator.And; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, CombinedFieldsOperator value, JsonSerializerOptions options) + { + switch (value) + { + case CombinedFieldsOperator.Or: + writer.WriteStringValue("or"); + return; + case CombinedFieldsOperator.And: + writer.WriteStringValue("and"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(CombinedFieldsZeroTermsConverter))] +public enum CombinedFieldsZeroTerms +{ + /// + /// No documents are returned if the analyzer removes all tokens. + /// + [EnumMember(Value = "none")] + None, + /// + /// Returns all documents, similar to a `match_all` query. + /// + [EnumMember(Value = "all")] + All +} + +internal sealed class CombinedFieldsZeroTermsConverter : JsonConverter +{ + public override CombinedFieldsZeroTerms Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "none": + return CombinedFieldsZeroTerms.None; + case "all": + return CombinedFieldsZeroTerms.All; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, CombinedFieldsZeroTerms value, JsonSerializerOptions options) + { + switch (value) + { + case CombinedFieldsZeroTerms.None: + writer.WriteStringValue("none"); + return; + case CombinedFieldsZeroTerms.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FieldValueFactorModifierConverter))] +public enum FieldValueFactorModifier +{ + /// + /// Square the field value (multiply it by itself). + /// + [EnumMember(Value = "square")] + Square, + /// + /// Take the square root of the field value. + /// + [EnumMember(Value = "sqrt")] + Sqrt, + /// + /// Reciprocate the field value, same as `1/x` where `x` is the field’s value. + /// + [EnumMember(Value = "reciprocal")] + Reciprocal, + /// + /// Do not apply any multiplier to the field value. + /// + [EnumMember(Value = "none")] + None, + /// + /// Add 2 to the field value and take the common logarithm. + /// + [EnumMember(Value = "log2p")] + Log2p, + /// + /// Add 1 to the field value and take the common logarithm. + /// + [EnumMember(Value = "log1p")] + Log1p, + /// + /// Take the common logarithm of the field value.
Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use `log1p` instead.
+ ///
+ [EnumMember(Value = "log")] + Log, + /// + /// Add 2 to the field value and take the natural logarithm. + /// + [EnumMember(Value = "ln2p")] + Ln2p, + /// + /// Add 1 to the field value and take the natural logarithm. + /// + [EnumMember(Value = "ln1p")] + Ln1p, + /// + /// Take the natural logarithm of the field value.
Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use `ln1p` instead.
+ ///
+ [EnumMember(Value = "ln")] + Ln +} + +internal sealed class FieldValueFactorModifierConverter : JsonConverter +{ + public override FieldValueFactorModifier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "square": + return FieldValueFactorModifier.Square; + case "sqrt": + return FieldValueFactorModifier.Sqrt; + case "reciprocal": + return FieldValueFactorModifier.Reciprocal; + case "none": + return FieldValueFactorModifier.None; + case "log2p": + return FieldValueFactorModifier.Log2p; + case "log1p": + return FieldValueFactorModifier.Log1p; + case "log": + return FieldValueFactorModifier.Log; + case "ln2p": + return FieldValueFactorModifier.Ln2p; + case "ln1p": + return FieldValueFactorModifier.Ln1p; + case "ln": + return FieldValueFactorModifier.Ln; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, FieldValueFactorModifier value, JsonSerializerOptions options) + { + switch (value) + { + case FieldValueFactorModifier.Square: + writer.WriteStringValue("square"); + return; + case FieldValueFactorModifier.Sqrt: + writer.WriteStringValue("sqrt"); + return; + case FieldValueFactorModifier.Reciprocal: + writer.WriteStringValue("reciprocal"); + return; + case FieldValueFactorModifier.None: + writer.WriteStringValue("none"); + return; + case FieldValueFactorModifier.Log2p: + writer.WriteStringValue("log2p"); + return; + case FieldValueFactorModifier.Log1p: + writer.WriteStringValue("log1p"); + return; + case FieldValueFactorModifier.Log: + writer.WriteStringValue("log"); + return; + case FieldValueFactorModifier.Ln2p: + writer.WriteStringValue("ln2p"); + return; + case FieldValueFactorModifier.Ln1p: + writer.WriteStringValue("ln1p"); + return; + case FieldValueFactorModifier.Ln: + writer.WriteStringValue("ln"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FunctionBoostModeConverter))] +public enum FunctionBoostMode +{ + /// + /// Query score and function score are added + /// + [EnumMember(Value = "sum")] + Sum, + /// + /// Only the function score is used.
The query score is ignored.
+ ///
+ [EnumMember(Value = "replace")] + Replace, + /// + /// Query score and function score are multiplied + /// + [EnumMember(Value = "multiply")] + Multiply, + /// + /// Min of query score and function score + /// + [EnumMember(Value = "min")] + Min, + /// + /// Max of query score and function score + /// + [EnumMember(Value = "max")] + Max, + /// + /// Query score and function score are averaged + /// + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class FunctionBoostModeConverter : JsonConverter +{ + public override FunctionBoostMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return FunctionBoostMode.Sum; + case "replace": + return FunctionBoostMode.Replace; + case "multiply": + return FunctionBoostMode.Multiply; + case "min": + return FunctionBoostMode.Min; + case "max": + return FunctionBoostMode.Max; + case "avg": + return FunctionBoostMode.Avg; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, FunctionBoostMode value, JsonSerializerOptions options) + { + switch (value) + { + case FunctionBoostMode.Sum: + writer.WriteStringValue("sum"); + return; + case FunctionBoostMode.Replace: + writer.WriteStringValue("replace"); + return; + case FunctionBoostMode.Multiply: + writer.WriteStringValue("multiply"); + return; + case FunctionBoostMode.Min: + writer.WriteStringValue("min"); + return; + case FunctionBoostMode.Max: + writer.WriteStringValue("max"); + return; + case FunctionBoostMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FunctionScoreModeConverter))] +public enum FunctionScoreMode +{ + /// + /// Scores are summed. + /// + [EnumMember(Value = "sum")] + Sum, + /// + /// Scores are multiplied. + /// + [EnumMember(Value = "multiply")] + Multiply, + /// + /// Minimum score is used. + /// + [EnumMember(Value = "min")] + Min, + /// + /// Maximum score is used. + /// + [EnumMember(Value = "max")] + Max, + /// + /// The first function that has a matching filter is applied. + /// + [EnumMember(Value = "first")] + First, + /// + /// Scores are averaged. + /// + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class FunctionScoreModeConverter : JsonConverter +{ + public override FunctionScoreMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return FunctionScoreMode.Sum; + case "multiply": + return FunctionScoreMode.Multiply; + case "min": + return FunctionScoreMode.Min; + case "max": + return FunctionScoreMode.Max; + case "first": + return FunctionScoreMode.First; + case "avg": + return FunctionScoreMode.Avg; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, FunctionScoreMode value, JsonSerializerOptions options) + { + switch (value) + { + case FunctionScoreMode.Sum: + writer.WriteStringValue("sum"); + return; + case FunctionScoreMode.Multiply: + writer.WriteStringValue("multiply"); + return; + case FunctionScoreMode.Min: + writer.WriteStringValue("min"); + return; + case FunctionScoreMode.Max: + writer.WriteStringValue("max"); + return; + case FunctionScoreMode.First: + writer.WriteStringValue("first"); + return; + case FunctionScoreMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GeoValidationMethodConverter))] +public enum GeoValidationMethod +{ + [EnumMember(Value = "strict")] + Strict, + /// + /// Accept geo points with invalid latitude or longitude. + /// + [EnumMember(Value = "ignore_malformed")] + IgnoreMalformed, + /// + /// Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates. + /// + [EnumMember(Value = "coerce")] + Coerce +} + +internal sealed class GeoValidationMethodConverter : JsonConverter +{ + public override GeoValidationMethod Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "strict": + return GeoValidationMethod.Strict; + case "ignore_malformed": + return GeoValidationMethod.IgnoreMalformed; + case "coerce": + return GeoValidationMethod.Coerce; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, JsonSerializerOptions options) + { + switch (value) + { + case GeoValidationMethod.Strict: + writer.WriteStringValue("strict"); + return; + case GeoValidationMethod.IgnoreMalformed: + writer.WriteStringValue("ignore_malformed"); + return; + case GeoValidationMethod.Coerce: + writer.WriteStringValue("coerce"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(OperatorConverter))] +public enum Operator +{ + [EnumMember(Value = "or")] + Or, + [EnumMember(Value = "and")] + And +} + +internal sealed class OperatorConverter : JsonConverter +{ + public override Operator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "or": + case "OR": + return Operator.Or; + case "and": + case "AND": + return Operator.And; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, Operator value, JsonSerializerOptions options) + { + switch (value) + { + case Operator.Or: + writer.WriteStringValue("or"); + return; + case Operator.And: + writer.WriteStringValue("and"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RangeRelationConverter))] +public enum RangeRelation +{ + /// + /// Matches documents with a range field value entirely within the query’s range. + /// + [EnumMember(Value = "within")] + Within, + /// + /// Matches documents with a range field value that intersects the query’s range. + /// + [EnumMember(Value = "intersects")] + Intersects, + /// + /// Matches documents with a range field value that entirely contains the query’s range. + /// + [EnumMember(Value = "contains")] + Contains +} + +internal sealed class RangeRelationConverter : JsonConverter +{ + public override RangeRelation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "within": + return RangeRelation.Within; + case "intersects": + return RangeRelation.Intersects; + case "contains": + return RangeRelation.Contains; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, RangeRelation value, JsonSerializerOptions options) + { + switch (value) + { + case RangeRelation.Within: + writer.WriteStringValue("within"); + return; + case RangeRelation.Intersects: + writer.WriteStringValue("intersects"); + return; + case RangeRelation.Contains: + writer.WriteStringValue("contains"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SimpleQueryStringFlagsConverter))] +[Flags] +public enum SimpleQueryStringFlags +{ + /// + /// Enables whitespace as split characters. + /// + [EnumMember(Value = "WHITESPACE")] + Whitespace = 1 << 0, + /// + /// Enables the `~N` operator, after a phrase where `N` is maximum number of positions allowed between matching tokens.
Synonymous to `NEAR`.
+ ///
+ [EnumMember(Value = "SLOP")] + Slop = 1 << 1, + /// + /// Enables the `*` prefix operator. + /// + [EnumMember(Value = "PREFIX")] + Prefix = 1 << 2, + /// + /// Enables the `(` and `)` operators to control operator precedence. + /// + [EnumMember(Value = "PRECEDENCE")] + Precedence = 1 << 3, + /// + /// Enables the `"` quotes operator used to search for phrases. + /// + [EnumMember(Value = "PHRASE")] + Phrase = 1 << 4, + /// + /// Enables the `\|` OR operator. + /// + [EnumMember(Value = "OR")] + Or = 1 << 5, + /// + /// Enables the `-` NOT operator. + /// + [EnumMember(Value = "NOT")] + Not = 1 << 6, + /// + /// Disables all operators. + /// + [EnumMember(Value = "NONE")] + None = 1 << 7, + /// + /// Enables the `~N` operator, after a phrase where `N` is the maximum number of positions allowed between matching tokens.
Synonymous to `SLOP`.
+ ///
+ [EnumMember(Value = "NEAR")] + Near = 1 << 8, + /// + /// Enables the `~N` operator after a word, where `N` is an integer denoting the allowed edit distance for matching. + /// + [EnumMember(Value = "FUZZY")] + Fuzzy = 1 << 9, + /// + /// Enables `\` as an escape character. + /// + [EnumMember(Value = "ESCAPE")] + Escape = 1 << 10, + /// + /// Enables the `+` AND operator. + /// + [EnumMember(Value = "AND")] + And = 1 << 11, + /// + /// Enables all optional operators. + /// + [EnumMember(Value = "ALL")] + All = 1 << 12 +} + +internal sealed class SimpleQueryStringFlagsConverter : JsonConverter +{ + public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var s = reader.GetString(); + if (string.IsNullOrEmpty(s)) + { + return default; + } + + var flags = s.Split('|'); + var result = default(SimpleQueryStringFlags); + foreach (var flag in flags) + { + result |= flag switch + { + "WHITESPACE" => SimpleQueryStringFlags.Whitespace, + "SLOP" => SimpleQueryStringFlags.Slop, + "PREFIX" => SimpleQueryStringFlags.Prefix, + "PRECEDENCE" => SimpleQueryStringFlags.Precedence, + "PHRASE" => SimpleQueryStringFlags.Phrase, + "OR" => SimpleQueryStringFlags.Or, + "NOT" => SimpleQueryStringFlags.Not, + "NONE" => SimpleQueryStringFlags.None, + "NEAR" => SimpleQueryStringFlags.Near, + "FUZZY" => SimpleQueryStringFlags.Fuzzy, + "ESCAPE" => SimpleQueryStringFlags.Escape, + "AND" => SimpleQueryStringFlags.And, + "ALL" => SimpleQueryStringFlags.All, + _ => throw new JsonException($"Invalid flag value '{flag}' for type '{typeToConvert.Name}'.") + }; + } + + return result; + } + + public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlags value, JsonSerializerOptions options) + { + if (value == default) + { + writer.WriteStringValue(string.Empty); + return; + } + + var sb = new StringBuilder(); + if (value.HasFlag(SimpleQueryStringFlags.Whitespace)) + sb.Append("WHITESPACE|"); + if (value.HasFlag(SimpleQueryStringFlags.Slop)) + sb.Append("SLOP|"); + if (value.HasFlag(SimpleQueryStringFlags.Prefix)) + sb.Append("PREFIX|"); + if (value.HasFlag(SimpleQueryStringFlags.Precedence)) + sb.Append("PRECEDENCE|"); + if (value.HasFlag(SimpleQueryStringFlags.Phrase)) + sb.Append("PHRASE|"); + if (value.HasFlag(SimpleQueryStringFlags.Or)) + sb.Append("OR|"); + if (value.HasFlag(SimpleQueryStringFlags.Not)) + sb.Append("NOT|"); + if (value.HasFlag(SimpleQueryStringFlags.None)) + sb.Append("NONE|"); + if (value.HasFlag(SimpleQueryStringFlags.Near)) + sb.Append("NEAR|"); + if (value.HasFlag(SimpleQueryStringFlags.Fuzzy)) + sb.Append("FUZZY|"); + if (value.HasFlag(SimpleQueryStringFlags.Escape)) + sb.Append("ESCAPE|"); + if (value.HasFlag(SimpleQueryStringFlags.And)) + sb.Append("AND|"); + if (value.HasFlag(SimpleQueryStringFlags.All)) + sb.Append("ALL|"); + if (sb.Length == 0) + { + writer.WriteStringValue(string.Empty); + return; + } + + sb.Remove(sb.Length - 1, 1); + writer.WriteStringValue(sb.ToString()); + } +} + +[JsonConverter(typeof(TextQueryTypeConverter))] +public enum TextQueryType +{ + /// + /// Runs a `match_phrase_prefix` query on each field and uses the `_score` from the best field. + /// + [EnumMember(Value = "phrase_prefix")] + PhrasePrefix, + /// + /// Runs a `match_phrase` query on each field and uses the `_score` from the best field. + /// + [EnumMember(Value = "phrase")] + Phrase, + /// + /// Finds documents that match any field and combines the `_score` from each field. + /// + [EnumMember(Value = "most_fields")] + MostFields, + /// + /// Treats fields with the same analyzer as though they were one big field.
Looks for each word in any field.
+ ///
+ [EnumMember(Value = "cross_fields")] + CrossFields, + /// + /// Creates a `match_bool_prefix` query on each field and combines the `_score` from each field. + /// + [EnumMember(Value = "bool_prefix")] + BoolPrefix, + /// + /// Finds documents that match any field, but uses the `_score` from the best field. + /// + [EnumMember(Value = "best_fields")] + BestFields +} + +internal sealed class TextQueryTypeConverter : JsonConverter +{ + public override TextQueryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "phrase_prefix": + return TextQueryType.PhrasePrefix; + case "phrase": + return TextQueryType.Phrase; + case "most_fields": + return TextQueryType.MostFields; + case "cross_fields": + return TextQueryType.CrossFields; + case "bool_prefix": + return TextQueryType.BoolPrefix; + case "best_fields": + return TextQueryType.BestFields; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, TextQueryType value, JsonSerializerOptions options) + { + switch (value) + { + case TextQueryType.PhrasePrefix: + writer.WriteStringValue("phrase_prefix"); + return; + case TextQueryType.Phrase: + writer.WriteStringValue("phrase"); + return; + case TextQueryType.MostFields: + writer.WriteStringValue("most_fields"); + return; + case TextQueryType.CrossFields: + writer.WriteStringValue("cross_fields"); + return; + case TextQueryType.BoolPrefix: + writer.WriteStringValue("bool_prefix"); + return; + case TextQueryType.BestFields: + writer.WriteStringValue("best_fields"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ZeroTermsQueryConverter))] +public enum ZeroTermsQuery +{ + /// + /// No documents are returned if the `analyzer` removes all tokens. + /// + [EnumMember(Value = "none")] + None, + /// + /// Returns all documents, similar to a `match_all` query. + /// + [EnumMember(Value = "all")] + All +} + +internal sealed class ZeroTermsQueryConverter : JsonConverter +{ + public override ZeroTermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "none": + return ZeroTermsQuery.None; + case "all": + return ZeroTermsQuery.All; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ZeroTermsQuery value, JsonSerializerOptions options) + { + switch (value) + { + case ZeroTermsQuery.None: + writer.WriteStringValue("none"); + return; + case ZeroTermsQuery.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Watcher.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Watcher.g.cs new file mode 100644 index 00000000000..d1f3f73e36d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Watcher.g.cs @@ -0,0 +1,84 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; + +namespace Elastic.Clients.Elasticsearch.Serverless.Watcher; + +[JsonConverter(typeof(ActionStatusOptionsConverter))] +public enum ActionStatusOptions +{ + [EnumMember(Value = "throttled")] + Throttled, + [EnumMember(Value = "success")] + Success, + [EnumMember(Value = "simulated")] + Simulated, + [EnumMember(Value = "failure")] + Failure +} + +internal sealed class ActionStatusOptionsConverter : JsonConverter +{ + public override ActionStatusOptions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "throttled": + return ActionStatusOptions.Throttled; + case "success": + return ActionStatusOptions.Success; + case "simulated": + return ActionStatusOptions.Simulated; + case "failure": + return ActionStatusOptions.Failure; + } + + ThrowHelper.ThrowJsonException(); return default; + } + + public override void Write(Utf8JsonWriter writer, ActionStatusOptions value, JsonSerializerOptions options) + { + switch (value) + { + case ActionStatusOptions.Throttled: + writer.WriteStringValue("throttled"); + return; + case ActionStatusOptions.Success: + writer.WriteStringValue("success"); + return; + case ActionStatusOptions.Simulated: + writer.WriteStringValue("simulated"); + return; + case ActionStatusOptions.Failure: + writer.WriteStringValue("failure"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs new file mode 100644 index 00000000000..af66e79ca9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs @@ -0,0 +1,124 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed partial class ErrorCauseConverter : JsonConverter +{ + public override ErrorCause Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + Elastic.Clients.Elasticsearch.Serverless.ErrorCause? causedBy = default; + string? reason = default; + IReadOnlyCollection? rootCause = default; + string? stackTrace = default; + IReadOnlyCollection? suppressed = default; + string type = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "caused_by") + { + causedBy = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "reason") + { + reason = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "root_cause") + { + rootCause = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stack_trace") + { + stackTrace = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "suppressed") + { + suppressed = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "type") + { + type = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var value = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, value); + } + } + + return new ErrorCause { CausedBy = causedBy, Reason = reason, RootCause = rootCause, StackTrace = stackTrace, Suppressed = suppressed, Type = type, Metadata = additionalProperties }; + } + + public override void Write(Utf8JsonWriter writer, ErrorCause value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ErrorCause' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ErrorCauseConverter))] +/// +/// 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.
+///
+public sealed partial class ErrorCause +{ + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? CausedBy { get; init; } + public IReadOnlyDictionary Metadata { get; init; } + + /// + /// A human-readable explanation of the error, in english + /// + public string? Reason { get; init; } + public IReadOnlyCollection? RootCause { get; init; } + + /// + /// The server stack trace. Present only if the `error_trace=true` parameter was sent with the request. + /// + public string? StackTrace { get; init; } + public IReadOnlyCollection? Suppressed { get; init; } + + /// + /// The type of error + /// + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs new file mode 100644 index 00000000000..20bf82fe8a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// The response returned by Elasticsearch when request execution did not succeed. +/// +public abstract partial class ErrorResponseBase +{ + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Error { get; init; } + [JsonInclude, JsonPropertyName("status")] + public int Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs new file mode 100644 index 00000000000..01b9f967dac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed class ExpandWildcardsConverter : SingleOrManyCollectionConverter +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs new file mode 100644 index 00000000000..c98dbf6dd7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed class FeaturesConverter : SingleOrManyCollectionConverter +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldMemoryUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldMemoryUsage.g.cs new file mode 100644 index 00000000000..1c68d895a3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldMemoryUsage.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FieldMemoryUsage +{ + [JsonInclude, JsonPropertyName("memory_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MemorySize { get; init; } + [JsonInclude, JsonPropertyName("memory_size_in_bytes")] + public long MemorySizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSizeUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSizeUsage.g.cs new file mode 100644 index 00000000000..d6737dfbcb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSizeUsage.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FieldSizeUsage +{ + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Size { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public long SizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs new file mode 100644 index 00000000000..8f9db3547de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs @@ -0,0 +1,320 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FieldSort +{ + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("missing")] + public FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } + [JsonInclude, JsonPropertyName("nested")] + public Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? Nested { get; set; } + [JsonInclude, JsonPropertyName("numeric_type")] + public Elastic.Clients.Elasticsearch.Serverless.FieldSortNumericType? NumericType { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("unmapped_type")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldType? UnmappedType { get; set; } +} + +public sealed partial class FieldSortDescriptor : SerializableDescriptor> +{ + internal FieldSortDescriptor(Action> configure) => configure.Invoke(this); + + public FieldSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } + private string? FormatValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldSortNumericType? NumericTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldType? UnmappedTypeValue { get; set; } + + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public FieldSortDescriptor Nested(Action> configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public FieldSortDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public FieldSortDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public FieldSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public FieldSortDescriptor NumericType(Elastic.Clients.Elasticsearch.Serverless.FieldSortNumericType? numericType) + { + NumericTypeValue = numericType; + return Self; + } + + public FieldSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public FieldSortDescriptor UnmappedType(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldType? unmappedType) + { + UnmappedTypeValue = unmappedType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (NumericTypeValue is not null) + { + writer.WritePropertyName("numeric_type"); + JsonSerializer.Serialize(writer, NumericTypeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (UnmappedTypeValue is not null) + { + writer.WritePropertyName("unmapped_type"); + JsonSerializer.Serialize(writer, UnmappedTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FieldSortDescriptor : SerializableDescriptor +{ + internal FieldSortDescriptor(Action configure) => configure.Invoke(this); + + public FieldSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } + private string? FormatValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldSortNumericType? NumericTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldType? UnmappedTypeValue { get; set; } + + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public FieldSortDescriptor Nested(Action configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public FieldSortDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public FieldSortDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + + public FieldSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public FieldSortDescriptor NumericType(Elastic.Clients.Elasticsearch.Serverless.FieldSortNumericType? numericType) + { + NumericTypeValue = numericType; + return Self; + } + + public FieldSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public FieldSortDescriptor UnmappedType(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldType? unmappedType) + { + UnmappedTypeValue = unmappedType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (NumericTypeValue is not null) + { + writer.WritePropertyName("numeric_type"); + JsonSerializer.Serialize(writer, NumericTypeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (UnmappedTypeValue is not null) + { + writer.WritePropertyName("unmapped_type"); + JsonSerializer.Serialize(writer, UnmappedTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FielddataStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FielddataStats.g.cs new file mode 100644 index 00000000000..56985a0b49d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FielddataStats.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FielddataStats +{ + [JsonInclude, JsonPropertyName("evictions")] + public long? Evictions { get; init; } + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.FieldMemoryUsage))] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("memory_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MemorySize { get; init; } + [JsonInclude, JsonPropertyName("memory_size_in_bytes")] + public long MemorySizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FlushStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FlushStats.g.cs new file mode 100644 index 00000000000..765b09ff5eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FlushStats.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class FlushStats +{ + [JsonInclude, JsonPropertyName("periodic")] + public long Periodic { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs new file mode 100644 index 00000000000..58dde2b08e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class Fuzziness : Union +{ + public Fuzziness(string fuzziness) : base(fuzziness) + { + } + + public Fuzziness(int fuzziness) : base(fuzziness) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoBounds.g.cs new file mode 100644 index 00000000000..43284d37d75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoBounds.g.cs @@ -0,0 +1,141 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// 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
+///
+[JsonConverter(typeof(GeoBoundsConverter))] +public sealed partial class GeoBounds : IComplexUnion +{ + public enum Kind + { + Coordinates, + TopLeftBottomRight, + TopRightBottomLeft, + Wkt + } + + private readonly Kind _kind; + private readonly object _value; + + Kind IComplexUnion.ValueKind => _kind; + + object IComplexUnion.Value => _value; + + private GeoBounds(Kind kind, object value) + { + _kind = kind; + _value = value; + } + + public static GeoBounds Coordinates(Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds coordinates) => new(Kind.Coordinates, coordinates); + + public bool IsCoordinates => _kind == Kind.Coordinates; + + public bool TryGetCoordinates([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds? coordinates) + { + coordinates = null; + if (_kind == Kind.Coordinates) + { + coordinates = (Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds)_value; + return true; + } + + return false; + } + + public static implicit operator GeoBounds(Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds coordinates) => GeoBounds.Coordinates(coordinates); + + public static GeoBounds TopLeftBottomRight(Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds topLeftBottomRight) => new(Kind.TopLeftBottomRight, topLeftBottomRight); + + public bool IsTopLeftBottomRight => _kind == Kind.TopLeftBottomRight; + + public bool TryGetTopLeftBottomRight([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds? topLeftBottomRight) + { + topLeftBottomRight = null; + if (_kind == Kind.TopLeftBottomRight) + { + topLeftBottomRight = (Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds)_value; + return true; + } + + return false; + } + + public static implicit operator GeoBounds(Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds topLeftBottomRight) => GeoBounds.TopLeftBottomRight(topLeftBottomRight); + + public static GeoBounds TopRightBottomLeft(Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds topRightBottomLeft) => new(Kind.TopRightBottomLeft, topRightBottomLeft); + + public bool IsTopRightBottomLeft => _kind == Kind.TopRightBottomLeft; + + public bool TryGetTopRightBottomLeft([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds? topRightBottomLeft) + { + topRightBottomLeft = null; + if (_kind == Kind.TopRightBottomLeft) + { + topRightBottomLeft = (Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds)_value; + return true; + } + + return false; + } + + public static implicit operator GeoBounds(Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds topRightBottomLeft) => GeoBounds.TopRightBottomLeft(topRightBottomLeft); + + public static GeoBounds Wkt(Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds wkt) => new(Kind.Wkt, wkt); + + public bool IsWkt => _kind == Kind.Wkt; + + public bool TryGetWkt([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds? wkt) + { + wkt = null; + if (_kind == Kind.Wkt) + { + wkt = (Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds)_value; + return true; + } + + return false; + } + + public static implicit operator GeoBounds(Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds wkt) => GeoBounds.Wkt(wkt); +} + +internal sealed class GeoBoundsConverter : MultiItemUnionConverter +{ + public GeoBoundsConverter() + { + _types = new Dictionary { { GeoBounds.Kind.Coordinates, typeof(Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds) }, { GeoBounds.Kind.TopLeftBottomRight, typeof(Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds) }, { GeoBounds.Kind.TopRightBottomLeft, typeof(Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds) }, { GeoBounds.Kind.Wkt, typeof(Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds) } }; + _factories = new Dictionary> { { typeof(Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds), o => GeoBounds.Coordinates((Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds)o) }, { typeof(Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds), o => GeoBounds.TopLeftBottomRight((Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds)o) }, { typeof(Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds), o => GeoBounds.TopRightBottomLeft((Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds)o) }, { typeof(Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds), o => GeoBounds.Wkt((Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds)o) } }; + _uniquePropertyToType = new Dictionary { { "bottom", typeof(Elastic.Clients.Elasticsearch.Serverless.CoordsGeoBounds) }, { "bottom_right", typeof(Elastic.Clients.Elasticsearch.Serverless.TopLeftBottomRightGeoBounds) }, { "bottom_left", typeof(Elastic.Clients.Elasticsearch.Serverless.TopRightBottomLeftGeoBounds) }, { "wkt", typeof(Elastic.Clients.Elasticsearch.Serverless.WktGeoBounds) } }; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs new file mode 100644 index 00000000000..fddd905368d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs @@ -0,0 +1,364 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed partial class GeoDistanceSortConverter : JsonConverter +{ + public override GeoDistanceSort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoDistanceSort(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "distance_type") + { + variant.DistanceType = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ignore_unmapped") + { + variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "mode") + { + variant.Mode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "order") + { + variant.Order = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "unit") + { + variant.Unit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Location = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoDistanceSort value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Location is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Location, options); + } + + if (value.DistanceType is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, value.DistanceType, options); + } + + if (value.IgnoreUnmapped.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(value.IgnoreUnmapped.Value); + } + + if (value.Mode is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, value.Mode, options); + } + + if (value.Order is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, value.Order, options); + } + + if (value.Unit is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, value.Unit, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoDistanceSortConverter))] +public sealed partial class GeoDistanceSort +{ + public Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceType { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public bool? IgnoreUnmapped { get; set; } + public ICollection Location { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? Unit { get; set; } + + public static implicit operator SortOptions(GeoDistanceSort geoDistanceSort) => SortOptions.GeoDistance(geoDistanceSort); +} + +public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor> +{ + internal GeoDistanceSortDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDistanceSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? UnitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection LocationValue { get; set; } + + public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + { + UnitValue = unit; + return Self; + } + + public GeoDistanceSortDescriptor Location(ICollection location) + { + LocationValue = location; + return Self; + } + + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && LocationValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor +{ + internal GeoDistanceSortDescriptor(Action configure) => configure.Invoke(this); + + public GeoDistanceSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? UnitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection LocationValue { get; set; } + + public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + { + UnitValue = unit; + return Self; + } + + public GeoDistanceSortDescriptor Location(ICollection location) + { + LocationValue = location; + return Self; + } + + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceSortDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && LocationValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (UnitValue is not null) + { + writer.WritePropertyName("unit"); + JsonSerializer.Serialize(writer, UnitValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs new file mode 100644 index 00000000000..595cf2cc946 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GeoHashLocation +{ + [JsonInclude, JsonPropertyName("geohash")] + public string Geohash { get; set; } +} + +public sealed partial class GeoHashLocationDescriptor : SerializableDescriptor +{ + internal GeoHashLocationDescriptor(Action configure) => configure.Invoke(this); + + public GeoHashLocationDescriptor() : base() + { + } + + private string GeohashValue { get; set; } + + public GeoHashLocationDescriptor Geohash(string geohash) + { + GeohashValue = geohash; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("geohash"); + JsonSerializer.Serialize(writer, GeohashValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLine.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLine.g.cs new file mode 100644 index 00000000000..b2e1fb20077 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLine.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// A GeoJson GeoLine. +/// +public sealed partial class GeoLine +{ + /// + /// Array of `[lon, lat]` coordinates + /// + [JsonInclude, JsonPropertyName("coordinates")] + public IReadOnlyCollection> Coordinates { get; init; } + + /// + /// Always `"LineString"` + /// + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs new file mode 100644 index 00000000000..db9e96ee043 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs @@ -0,0 +1,142 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// 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 `", "` or WKT point formats
+///
+[JsonConverter(typeof(GeoLocationConverter))] +public sealed partial class GeoLocation : IComplexUnion +{ + public enum Kind + { + LatitudeLongitude, + Geohash, + Coordinates, + Text + } + + private readonly Kind _kind; + private readonly object _value; + + Kind IComplexUnion.ValueKind => _kind; + + object IComplexUnion.Value => _value; + + private GeoLocation(Kind kind, object value) + { + _kind = kind; + _value = value; + } + + public static GeoLocation LatitudeLongitude(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation latitudeLongitude) => new(Kind.LatitudeLongitude, latitudeLongitude); + + public bool IsLatitudeLongitude => _kind == Kind.LatitudeLongitude; + + public bool TryGetLatitudeLongitude([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation? latitudeLongitude) + { + latitudeLongitude = null; + if (_kind == Kind.LatitudeLongitude) + { + latitudeLongitude = (Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation)_value; + return true; + } + + return false; + } + + public static implicit operator GeoLocation(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation latitudeLongitude) => GeoLocation.LatitudeLongitude(latitudeLongitude); + + public static GeoLocation Geohash(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation geohash) => new(Kind.Geohash, geohash); + + public bool IsGeohash => _kind == Kind.Geohash; + + public bool TryGetGeohash([NotNullWhen(true)] out Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation? geohash) + { + geohash = null; + if (_kind == Kind.Geohash) + { + geohash = (Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation)_value; + return true; + } + + return false; + } + + public static implicit operator GeoLocation(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation geohash) => GeoLocation.Geohash(geohash); + + public static GeoLocation Coordinates(double[] coordinates) => new(Kind.Coordinates, coordinates); + + public bool IsCoordinates => _kind == Kind.Coordinates; + + public bool TryGetCoordinates([NotNullWhen(true)] out double[]? coordinates) + { + coordinates = null; + if (_kind == Kind.Coordinates) + { + coordinates = (double[])_value; + return true; + } + + return false; + } + + public static implicit operator GeoLocation(double[] coordinates) => GeoLocation.Coordinates(coordinates); + + public static GeoLocation Text(string text) => new(Kind.Text, text); + + public bool IsText => _kind == Kind.Text; + + public bool TryGetText([NotNullWhen(true)] out string? text) + { + text = null; + if (_kind == Kind.Text) + { + text = (string)_value; + return true; + } + + return false; + } + + public static implicit operator GeoLocation(string text) => GeoLocation.Text(text); +} + +internal sealed class GeoLocationConverter : MultiItemUnionConverter +{ + public GeoLocationConverter() + { + _arrayType = typeof(double[]); + _types = new Dictionary { { GeoLocation.Kind.LatitudeLongitude, typeof(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation) }, { GeoLocation.Kind.Geohash, typeof(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation) }, { GeoLocation.Kind.Coordinates, typeof(double[]) }, { GeoLocation.Kind.Text, typeof(string) } }; + _factories = new Dictionary> { { typeof(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation), o => GeoLocation.LatitudeLongitude((Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation)o) }, { typeof(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation), o => GeoLocation.Geohash((Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation)o) }, { typeof(double[]), o => GeoLocation.Coordinates((double[])o) }, { typeof(string), o => GeoLocation.Text((string)o) } }; + _uniquePropertyToType = new Dictionary { { "lat", typeof(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation) }, { "geohash", typeof(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation) } }; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs new file mode 100644 index 00000000000..f68488b3d7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GeohashPrecision : Union +{ + public GeohashPrecision(double geohash_length) : base(geohash_length) + { + } + + public GeohashPrecision(string distance) : base(distance) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GetStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GetStats.g.cs new file mode 100644 index 00000000000..bdd4dd14fca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GetStats.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class GetStats +{ + [JsonInclude, JsonPropertyName("current")] + public long Current { get; init; } + [JsonInclude, JsonPropertyName("exists_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ExistsTime { get; init; } + [JsonInclude, JsonPropertyName("exists_time_in_millis")] + public long ExistsTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("exists_total")] + public long ExistsTotal { get; init; } + [JsonInclude, JsonPropertyName("missing_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MissingTime { get; init; } + [JsonInclude, JsonPropertyName("missing_time_in_millis")] + public long MissingTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("missing_total")] + public long MissingTotal { get; init; } + [JsonInclude, JsonPropertyName("time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Time { get; init; } + [JsonInclude, JsonPropertyName("time_in_millis")] + public long TimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Connection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Connection.g.cs new file mode 100644 index 00000000000..9314adb2e0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Connection.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class Connection +{ + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("source")] + public long Source { get; init; } + [JsonInclude, JsonPropertyName("target")] + public long Target { get; init; } + [JsonInclude, JsonPropertyName("weight")] + public double Weight { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs new file mode 100644 index 00000000000..3f8fc75ae09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs @@ -0,0 +1,267 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class ExploreControls +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("sample_diversity")] + public Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? SampleDiversity { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("sample_size")] + public int? SampleSize { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } + + /// + /// Filters associated terms so only those that are significantly associated with your query are included. + /// + [JsonInclude, JsonPropertyName("use_significance")] + public bool UseSignificance { get; set; } +} + +public sealed partial class ExploreControlsDescriptor : SerializableDescriptor> +{ + internal ExploreControlsDescriptor(Action> configure) => configure.Invoke(this); + + public ExploreControlsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? SampleDiversityValue { get; set; } + private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + private Action> SampleDiversityDescriptorAction { get; set; } + private int? SampleSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + private bool UseSignificanceValue { get; set; } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? sampleDiversity) + { + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = null; + SampleDiversityValue = sampleDiversity; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptor = descriptor; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Action> configure) + { + SampleDiversityValue = null; + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor SampleSize(int? sampleSize) + { + SampleSizeValue = sampleSize; + return Self; + } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// Filters associated terms so only those that are significantly associated with your query are included. + /// + public ExploreControlsDescriptor UseSignificance(bool useSignificance = true) + { + UseSignificanceValue = useSignificance; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SampleDiversityDescriptor is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityDescriptor, options); + } + else if (SampleDiversityDescriptorAction is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + } + else if (SampleDiversityValue is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityValue, options); + } + + if (SampleSizeValue.HasValue) + { + writer.WritePropertyName("sample_size"); + writer.WriteNumberValue(SampleSizeValue.Value); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WritePropertyName("use_significance"); + writer.WriteBooleanValue(UseSignificanceValue); + writer.WriteEndObject(); + } +} + +public sealed partial class ExploreControlsDescriptor : SerializableDescriptor +{ + internal ExploreControlsDescriptor(Action configure) => configure.Invoke(this); + + public ExploreControlsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? SampleDiversityValue { get; set; } + private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + private Action SampleDiversityDescriptorAction { get; set; } + private int? SampleSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + private bool UseSignificanceValue { get; set; } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? sampleDiversity) + { + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = null; + SampleDiversityValue = sampleDiversity; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptor = descriptor; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Action configure) + { + SampleDiversityValue = null; + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor SampleSize(int? sampleSize) + { + SampleSizeValue = sampleSize; + return Self; + } + + /// + /// 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.
+ ///
+ public ExploreControlsDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + /// + /// Filters associated terms so only those that are significantly associated with your query are included. + /// + public ExploreControlsDescriptor UseSignificance(bool useSignificance = true) + { + UseSignificanceValue = useSignificance; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SampleDiversityDescriptor is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityDescriptor, options); + } + else if (SampleDiversityDescriptorAction is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + } + else if (SampleDiversityValue is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityValue, options); + } + + if (SampleSizeValue.HasValue) + { + writer.WritePropertyName("sample_size"); + writer.WriteNumberValue(SampleSizeValue.Value); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WritePropertyName("use_significance"); + writer.WriteBooleanValue(UseSignificanceValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs new file mode 100644 index 00000000000..3eb4afcbae5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs @@ -0,0 +1,413 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class Hop +{ + /// + /// Specifies one or more fields from which you want to extract terms that are associated with the specified vertices. + /// + [JsonInclude, JsonPropertyName("connections")] + public Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? Connections { get; set; } + + /// + /// An optional guiding query that constrains the Graph API as it explores connected terms. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// Contains the fields you are interested in. + /// + [JsonInclude, JsonPropertyName("vertices")] + public ICollection Vertices { get; set; } +} + +public sealed partial class HopDescriptor : SerializableDescriptor> +{ + internal HopDescriptor(Action> configure) => configure.Invoke(this); + + public HopDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? ConnectionsValue { get; set; } + private HopDescriptor ConnectionsDescriptor { get; set; } + private Action> ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private ICollection VerticesValue { get; set; } + private VertexDefinitionDescriptor VerticesDescriptor { get; set; } + private Action> VerticesDescriptorAction { get; set; } + private Action>[] VerticesDescriptorActions { get; set; } + + /// + /// Specifies one or more fields from which you want to extract terms that are associated with the specified vertices. + /// + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public HopDescriptor Connections(HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public HopDescriptor Connections(Action> configure) + { + ConnectionsValue = null; + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + /// + /// An optional guiding query that constrains the Graph API as it explores connected terms. + /// + public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HopDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Contains the fields you are interested in. + /// + public HopDescriptor Vertices(ICollection vertices) + { + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesValue = vertices; + return Self; + } + + public HopDescriptor Vertices(VertexDefinitionDescriptor descriptor) + { + VerticesValue = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesDescriptor = descriptor; + return Self; + } + + public HopDescriptor Vertices(Action> configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorActions = null; + VerticesDescriptorAction = configure; + return Self; + } + + public HopDescriptor Vertices(params Action>[] configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesDescriptor is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, VerticesDescriptor, options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorAction is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorActions is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + foreach (var action in VerticesDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HopDescriptor : SerializableDescriptor +{ + internal HopDescriptor(Action configure) => configure.Invoke(this); + + public HopDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? ConnectionsValue { get; set; } + private HopDescriptor ConnectionsDescriptor { get; set; } + private Action ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private ICollection VerticesValue { get; set; } + private VertexDefinitionDescriptor VerticesDescriptor { get; set; } + private Action VerticesDescriptorAction { get; set; } + private Action[] VerticesDescriptorActions { get; set; } + + /// + /// Specifies one or more fields from which you want to extract terms that are associated with the specified vertices. + /// + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public HopDescriptor Connections(HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public HopDescriptor Connections(Action configure) + { + ConnectionsValue = null; + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + /// + /// An optional guiding query that constrains the Graph API as it explores connected terms. + /// + public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HopDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Contains the fields you are interested in. + /// + public HopDescriptor Vertices(ICollection vertices) + { + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesValue = vertices; + return Self; + } + + public HopDescriptor Vertices(VertexDefinitionDescriptor descriptor) + { + VerticesValue = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = null; + VerticesDescriptor = descriptor; + return Self; + } + + public HopDescriptor Vertices(Action configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorActions = null; + VerticesDescriptorAction = configure; + return Self; + } + + public HopDescriptor Vertices(params Action[] configure) + { + VerticesValue = null; + VerticesDescriptor = null; + VerticesDescriptorAction = null; + VerticesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesDescriptor is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, VerticesDescriptor, options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorAction is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (VerticesDescriptorActions is not null) + { + writer.WritePropertyName("vertices"); + writer.WriteStartArray(); + foreach (var action in VerticesDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs new file mode 100644 index 00000000000..8ea833e7218 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs @@ -0,0 +1,122 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class SampleDiversity +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("max_docs_per_value")] + public int MaxDocsPerValue { get; set; } +} + +public sealed partial class SampleDiversityDescriptor : SerializableDescriptor> +{ + internal SampleDiversityDescriptor(Action> configure) => configure.Invoke(this); + + public SampleDiversityDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int MaxDocsPerValueValue { get; set; } + + public SampleDiversityDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue); + writer.WriteEndObject(); + } +} + +public sealed partial class SampleDiversityDescriptor : SerializableDescriptor +{ + internal SampleDiversityDescriptor(Action configure) => configure.Invoke(this); + + public SampleDiversityDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int MaxDocsPerValueValue { get; set; } + + public SampleDiversityDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Vertex.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Vertex.g.cs new file mode 100644 index 00000000000..16e968ef411 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Vertex.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class Vertex +{ + [JsonInclude, JsonPropertyName("depth")] + public long Depth { get; init; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; init; } + [JsonInclude, JsonPropertyName("term")] + public string Term { get; init; } + [JsonInclude, JsonPropertyName("weight")] + public double Weight { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs new file mode 100644 index 00000000000..d959f5620f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs @@ -0,0 +1,426 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class VertexDefinition +{ + /// + /// Prevents the specified terms from being included in the results. + /// + [JsonInclude, JsonPropertyName("exclude")] + public ICollection? Exclude { get; set; } + + /// + /// Identifies a field in the documents of interest. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Identifies the terms of interest that form the starting points from which you want to spider out. + /// + [JsonInclude, JsonPropertyName("include")] + public ICollection? Include { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("min_doc_count")] + public long? MinDocCount { get; set; } + + /// + /// Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration. + /// + [JsonInclude, JsonPropertyName("shard_min_doc_count")] + public long? ShardMinDocCount { get; set; } + + /// + /// Specifies the maximum number of vertex terms returned for each field. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } +} + +public sealed partial class VertexDefinitionDescriptor : SerializableDescriptor> +{ + internal VertexDefinitionDescriptor(Action> configure) => configure.Invoke(this); + + public VertexDefinitionDescriptor() : base() + { + } + + private ICollection? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection? IncludeValue { get; set; } + private VertexIncludeDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } + private Action[] IncludeDescriptorActions { get; set; } + private long? MinDocCountValue { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Prevents the specified terms from being included in the results. + /// + public VertexDefinitionDescriptor Exclude(ICollection? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Identifies a field in the documents of interest. + /// + public VertexDefinitionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Identifies a field in the documents of interest. + /// + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Identifies the terms of interest that form the starting points from which you want to spider out. + /// + public VertexDefinitionDescriptor Include(ICollection? include) + { + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = null; + IncludeValue = include; + return Self; + } + + public VertexDefinitionDescriptor Include(VertexIncludeDescriptor descriptor) + { + IncludeValue = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = null; + IncludeDescriptor = descriptor; + return Self; + } + + public VertexDefinitionDescriptor Include(Action configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorActions = null; + IncludeDescriptorAction = configure; + return Self; + } + + public VertexDefinitionDescriptor Include(params Action[] configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public VertexDefinitionDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration. + /// + public VertexDefinitionDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// Specifies the maximum number of vertex terms returned for each field. + /// + public VertexDefinitionDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IncludeDescriptor is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IncludeDescriptor, options); + writer.WriteEndArray(); + } + else if (IncludeDescriptorAction is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IncludeDescriptorActions is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + foreach (var action in IncludeDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class VertexDefinitionDescriptor : SerializableDescriptor +{ + internal VertexDefinitionDescriptor(Action configure) => configure.Invoke(this); + + public VertexDefinitionDescriptor() : base() + { + } + + private ICollection? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection? IncludeValue { get; set; } + private VertexIncludeDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } + private Action[] IncludeDescriptorActions { get; set; } + private long? MinDocCountValue { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Prevents the specified terms from being included in the results. + /// + public VertexDefinitionDescriptor Exclude(ICollection? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Identifies a field in the documents of interest. + /// + public VertexDefinitionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Identifies a field in the documents of interest. + /// + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Identifies a field in the documents of interest. + /// + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Identifies the terms of interest that form the starting points from which you want to spider out. + /// + public VertexDefinitionDescriptor Include(ICollection? include) + { + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = null; + IncludeValue = include; + return Self; + } + + public VertexDefinitionDescriptor Include(VertexIncludeDescriptor descriptor) + { + IncludeValue = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = null; + IncludeDescriptor = descriptor; + return Self; + } + + public VertexDefinitionDescriptor Include(Action configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorActions = null; + IncludeDescriptorAction = configure; + return Self; + } + + public VertexDefinitionDescriptor Include(params Action[] configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeDescriptorActions = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public VertexDefinitionDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + /// + /// Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration. + /// + public VertexDefinitionDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// Specifies the maximum number of vertex terms returned for each field. + /// + public VertexDefinitionDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IncludeDescriptor is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IncludeDescriptor, options); + writer.WriteEndArray(); + } + else if (IncludeDescriptorAction is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IncludeDescriptorActions is not null) + { + writer.WritePropertyName("include"); + writer.WriteStartArray(); + foreach (var action in IncludeDescriptorActions) + { + JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexInclude.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexInclude.g.cs new file mode 100644 index 00000000000..0671c7c3195 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexInclude.g.cs @@ -0,0 +1,70 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Graph; + +public sealed partial class VertexInclude +{ + [JsonInclude, JsonPropertyName("boost")] + public double Boost { get; set; } + [JsonInclude, JsonPropertyName("term")] + public string Term { get; set; } +} + +public sealed partial class VertexIncludeDescriptor : SerializableDescriptor +{ + internal VertexIncludeDescriptor(Action configure) => configure.Invoke(this); + + public VertexIncludeDescriptor() : base() + { + } + + private double BoostValue { get; set; } + private string TermValue { get; set; } + + public VertexIncludeDescriptor Boost(double boost) + { + BoostValue = boost; + return Self; + } + + public VertexIncludeDescriptor Term(string term) + { + TermValue = term; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue); + writer.WritePropertyName("term"); + writer.WriteStringValue(TermValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs new file mode 100644 index 00000000000..ab35b2a6efc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +[JsonConverter(typeof(ActionConverter))] +public sealed partial class Action +{ + internal Action(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static Action Add(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AddAction addAction) => new Action("add", addAction); + public static Action Remove(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveAction removeAction) => new Action("remove", removeAction); + public static Action RemoveIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveIndexAction removeIndexAction) => new Action("remove_index", removeIndexAction); +} + +internal sealed partial class ActionConverter : JsonConverter +{ + public override Action Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "add") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Action(propertyName, variant); + } + + if (propertyName == "remove") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Action(propertyName, variant); + } + + if (propertyName == "remove_index") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Action(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "add": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AddAction)value.Variant, options); + break; + case "remove": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveAction)value.Variant, options); + break; + case "remove_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveIndexAction)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ActionDescriptor : SerializableDescriptor> +{ + internal ActionDescriptor(Action> configure) => configure.Invoke(this); + + public ActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private ActionDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private ActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public ActionDescriptor Add(AddAction addAction) => Set(addAction, "add"); + public ActionDescriptor Add(Action> configure) => Set(configure, "add"); + public ActionDescriptor Remove(RemoveAction removeAction) => Set(removeAction, "remove"); + public ActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public ActionDescriptor RemoveIndex(RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public ActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class ActionDescriptor : SerializableDescriptor +{ + internal ActionDescriptor(Action configure) => configure.Invoke(this); + + public ActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private ActionDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private ActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public ActionDescriptor Add(AddAction addAction) => Set(addAction, "add"); + public ActionDescriptor Add(Action configure) => Set(configure, "add"); + public ActionDescriptor Add(Action> configure) => Set(configure, "add"); + public ActionDescriptor Remove(RemoveAction removeAction) => Set(removeAction, "remove"); + public ActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public ActionDescriptor RemoveIndex(RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public ActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs new file mode 100644 index 00000000000..dd5bf5af9df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs @@ -0,0 +1,543 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class AddAction +{ + /// + /// Alias for the action.
Index alias names support date math.
+ ///
+ [JsonInclude, JsonPropertyName("alias")] + public Elastic.Clients.Elasticsearch.Serverless.IndexAlias? Alias { get; set; } + + /// + /// Aliases for the action.
Index alias names support date math.
+ ///
+ [JsonInclude, JsonPropertyName("aliases"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexAlias))] + public ICollection? Aliases { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("index_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRouting { get; set; } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// If `true`, the alias is hidden. + /// + [JsonInclude, JsonPropertyName("is_hidden")] + public bool? IsHidden { get; set; } + + /// + /// If `true`, sets the write index or data stream for the alias. + /// + [JsonInclude, JsonPropertyName("is_write_index")] + public bool? IsWriteIndex { get; set; } + + /// + /// If `true`, the alias must exist to perform the action. + /// + [JsonInclude, JsonPropertyName("must_exist")] + public bool? MustExist { get; set; } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("search_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRouting { get; set; } + + public static implicit operator Action(AddAction addAction) => IndexManagement.Action.Add(addAction); +} + +public sealed partial class AddActionDescriptor : SerializableDescriptor> +{ + internal AddActionDescriptor(Action> configure) => configure.Invoke(this); + + public AddActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexAlias? AliasValue { get; set; } + private ICollection? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? IsHiddenValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private bool? MustExistValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public AddActionDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Alias for the action.
Index alias names support date math.
+ ///
+ public AddActionDescriptor Alias(Elastic.Clients.Elasticsearch.Serverless.IndexAlias? alias) + { + AliasValue = alias; + return Self; + } + + /// + /// Aliases for the action.
Index alias names support date math.
+ ///
+ public AddActionDescriptor Aliases(ICollection? aliases) + { + AliasesValue = aliases; + return Self; + } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ public AddActionDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// 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.
+ ///
+ public AddActionDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ public AddActionDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// If `true`, the alias is hidden. + /// + public AddActionDescriptor IsHidden(bool? isHidden = true) + { + IsHiddenValue = isHidden; + return Self; + } + + /// + /// If `true`, sets the write index or data stream for the alias. + /// + public AddActionDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// If `true`, the alias must exist to perform the action. + /// + public AddActionDescriptor MustExist(bool? mustExist = true) + { + MustExistValue = mustExist; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ public AddActionDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// 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.
+ ///
+ public AddActionDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (AliasValue is not null) + { + writer.WritePropertyName("alias"); + JsonSerializer.Serialize(writer, AliasValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + SingleOrManySerializationHelper.Serialize(AliasesValue, writer, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IsHiddenValue.HasValue) + { + writer.WritePropertyName("is_hidden"); + writer.WriteBooleanValue(IsHiddenValue.Value); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (MustExistValue.HasValue) + { + writer.WritePropertyName("must_exist"); + writer.WriteBooleanValue(MustExistValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AddActionDescriptor : SerializableDescriptor +{ + internal AddActionDescriptor(Action configure) => configure.Invoke(this); + + public AddActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexAlias? AliasValue { get; set; } + private ICollection? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? IsHiddenValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private bool? MustExistValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public AddActionDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Alias for the action.
Index alias names support date math.
+ ///
+ public AddActionDescriptor Alias(Elastic.Clients.Elasticsearch.Serverless.IndexAlias? alias) + { + AliasValue = alias; + return Self; + } + + /// + /// Aliases for the action.
Index alias names support date math.
+ ///
+ public AddActionDescriptor Aliases(ICollection? aliases) + { + AliasesValue = aliases; + return Self; + } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ public AddActionDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// 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.
+ ///
+ public AddActionDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ public AddActionDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// If `true`, the alias is hidden. + /// + public AddActionDescriptor IsHidden(bool? isHidden = true) + { + IsHiddenValue = isHidden; + return Self; + } + + /// + /// If `true`, sets the write index or data stream for the alias. + /// + public AddActionDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// If `true`, the alias must exist to perform the action. + /// + public AddActionDescriptor MustExist(bool? mustExist = true) + { + MustExistValue = mustExist; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
+ ///
+ public AddActionDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// 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.
+ ///
+ public AddActionDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (AliasValue is not null) + { + writer.WritePropertyName("alias"); + JsonSerializer.Serialize(writer, AliasValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + SingleOrManySerializationHelper.Serialize(AliasesValue, writer, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IsHiddenValue.HasValue) + { + writer.WritePropertyName("is_hidden"); + writer.WriteBooleanValue(IsHiddenValue.Value); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (MustExistValue.HasValue) + { + writer.WritePropertyName("must_exist"); + writer.WriteBooleanValue(MustExistValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs new file mode 100644 index 00000000000..cd85428022f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs @@ -0,0 +1,351 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Alias +{ + /// + /// Query used to limit documents the alias can access. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + + /// + /// Value used to route indexing operations to a specific shard.
If specified, this overwrites the `routing` value for indexing operations.
+ ///
+ [JsonInclude, JsonPropertyName("index_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRouting { get; set; } + + /// + /// If `true`, the alias is hidden.
All indices for the alias must have the same `is_hidden` value.
+ ///
+ [JsonInclude, JsonPropertyName("is_hidden")] + public bool? IsHidden { get; set; } + + /// + /// If `true`, the index is the write index for the alias. + /// + [JsonInclude, JsonPropertyName("is_write_index")] + public bool? IsWriteIndex { get; set; } + + /// + /// Value used to route indexing and search operations to a specific shard. + /// + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// Value used to route search operations to a specific shard.
If specified, this overwrites the `routing` value for search operations.
+ ///
+ [JsonInclude, JsonPropertyName("search_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRouting { get; set; } +} + +public sealed partial class AliasDescriptor : SerializableDescriptor> +{ + internal AliasDescriptor(Action> configure) => configure.Invoke(this); + + public AliasDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private bool? IsHiddenValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public AliasDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Value used to route indexing operations to a specific shard.
If specified, this overwrites the `routing` value for indexing operations.
+ ///
+ public AliasDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// If `true`, the alias is hidden.
All indices for the alias must have the same `is_hidden` value.
+ ///
+ public AliasDescriptor IsHidden(bool? isHidden = true) + { + IsHiddenValue = isHidden; + return Self; + } + + /// + /// If `true`, the index is the write index for the alias. + /// + public AliasDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard. + /// + public AliasDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// Value used to route search operations to a specific shard.
If specified, this overwrites the `routing` value for search operations.
+ ///
+ public AliasDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IsHiddenValue.HasValue) + { + writer.WritePropertyName("is_hidden"); + writer.WriteBooleanValue(IsHiddenValue.Value); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AliasDescriptor : SerializableDescriptor +{ + internal AliasDescriptor(Action configure) => configure.Invoke(this); + + public AliasDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? IndexRoutingValue { get; set; } + private bool? IsHiddenValue { get; set; } + private bool? IsWriteIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? SearchRoutingValue { get; set; } + + /// + /// Query used to limit documents the alias can access. + /// + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public AliasDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Value used to route indexing operations to a specific shard.
If specified, this overwrites the `routing` value for indexing operations.
+ ///
+ public AliasDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? indexRouting) + { + IndexRoutingValue = indexRouting; + return Self; + } + + /// + /// If `true`, the alias is hidden.
All indices for the alias must have the same `is_hidden` value.
+ ///
+ public AliasDescriptor IsHidden(bool? isHidden = true) + { + IsHiddenValue = isHidden; + return Self; + } + + /// + /// If `true`, the index is the write index for the alias. + /// + public AliasDescriptor IsWriteIndex(bool? isWriteIndex = true) + { + IsWriteIndexValue = isWriteIndex; + return Self; + } + + /// + /// Value used to route indexing and search operations to a specific shard. + /// + public AliasDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// Value used to route search operations to a specific shard.
If specified, this overwrites the `routing` value for search operations.
+ ///
+ public AliasDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Serverless.Routing? searchRouting) + { + SearchRoutingValue = searchRouting; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (IndexRoutingValue is not null) + { + writer.WritePropertyName("index_routing"); + JsonSerializer.Serialize(writer, IndexRoutingValue, options); + } + + if (IsHiddenValue.HasValue) + { + writer.WritePropertyName("is_hidden"); + writer.WriteBooleanValue(IsHiddenValue.Value); + } + + if (IsWriteIndexValue.HasValue) + { + writer.WritePropertyName("is_write_index"); + writer.WriteBooleanValue(IsWriteIndexValue.Value); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SearchRoutingValue is not null) + { + writer.WritePropertyName("search_routing"); + JsonSerializer.Serialize(writer, SearchRoutingValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AliasDefinition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AliasDefinition.g.cs new file mode 100644 index 00000000000..3084def3137 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AliasDefinition.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class AliasDefinition +{ + /// + /// Query used to limit documents the alias can access. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; init; } + + /// + /// Value used to route indexing operations to a specific shard.
If specified, this overwrites the `routing` value for indexing operations.
+ ///
+ [JsonInclude, JsonPropertyName("index_routing")] + public string? IndexRouting { get; init; } + + /// + /// If `true`, the alias is hidden.
All indices for the alias must have the same `is_hidden` value.
+ ///
+ [JsonInclude, JsonPropertyName("is_hidden")] + public bool? IsHidden { get; init; } + + /// + /// If `true`, the index is the write index for the alias. + /// + [JsonInclude, JsonPropertyName("is_write_index")] + public bool? IsWriteIndex { get; init; } + + /// + /// Value used to route indexing and search operations to a specific shard. + /// + [JsonInclude, JsonPropertyName("routing")] + public string? Routing { get; init; } + + /// + /// Value used to route search operations to a specific shard.
If specified, this overwrites the `routing` value for search operations.
+ ///
+ [JsonInclude, JsonPropertyName("search_routing")] + public string? SearchRouting { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CacheQueries.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CacheQueries.g.cs new file mode 100644 index 00000000000..3b086b3412d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CacheQueries.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CacheQueries +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class CacheQueriesDescriptor : SerializableDescriptor +{ + internal CacheQueriesDescriptor(Action configure) => configure.Invoke(this); + + public CacheQueriesDescriptor() : base() + { + } + + private bool EnabledValue { get; set; } + + public CacheQueriesDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseIndexResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseIndexResult.g.cs new file mode 100644 index 00000000000..d03a44b201c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseIndexResult.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CloseIndexResult +{ + [JsonInclude, JsonPropertyName("closed")] + public bool Closed { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary? Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseShardResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseShardResult.g.cs new file mode 100644 index 00000000000..c5d7f640878 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CloseShardResult.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class CloseShardResult +{ + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection Failures { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycle.g.cs new file mode 100644 index 00000000000..ccb98f655ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycle.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// Data lifecycle denotes that a data stream is managed by DLM and contains the configuration. +/// +public sealed partial class DataLifecycle +{ + [JsonInclude, JsonPropertyName("data_retention")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetention { get; set; } +} + +/// +/// Data lifecycle denotes that a data stream is managed by DLM and contains the configuration. +/// +public sealed partial class DataLifecycleDescriptor : SerializableDescriptor +{ + internal DataLifecycleDescriptor(Action configure) => configure.Invoke(this); + + public DataLifecycleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetentionValue { get; set; } + + public DataLifecycleDescriptor DataRetention(Elastic.Clients.Elasticsearch.Serverless.Duration? dataRetention) + { + DataRetentionValue = dataRetention; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DataRetentionValue is not null) + { + writer.WritePropertyName("data_retention"); + JsonSerializer.Serialize(writer, DataRetentionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleExplain.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleExplain.g.cs new file mode 100644 index 00000000000..706a9dd2b13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleExplain.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataLifecycleExplain +{ + [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + [JsonInclude, JsonPropertyName("generation_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? GenerationTime { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("index_creation_date_millis")] + public long? IndexCreationDateMillis { get; init; } + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycleWithRollover? Lifecycle { get; init; } + [JsonInclude, JsonPropertyName("managed_by_dlm")] + public bool ManagedByDlm { get; init; } + [JsonInclude, JsonPropertyName("rollover_date_millis")] + public long? RolloverDateMillis { get; init; } + [JsonInclude, JsonPropertyName("time_since_index_creation")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TimeSinceIndexCreation { get; init; } + [JsonInclude, JsonPropertyName("time_since_rollover")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TimeSinceRollover { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleWithRollover.g.cs new file mode 100644 index 00000000000..6dfd7fa2cbf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataLifecycleWithRollover.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// Data lifecycle with rollover can be used to display the configuration including the default rollover conditions,
if asked.
+///
+public sealed partial class DataLifecycleWithRollover +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("data_retention")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetention { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("rollover")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DlmRolloverConditions? Rollover { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs new file mode 100644 index 00000000000..cbfec13f296 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataStream +{ + /// + /// Custom metadata for the stream, copied from the `_meta` object of the stream’s matching index template.
If empty, the response omits this property.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// If `true`, the data stream allows custom routing on write request. + /// + [JsonInclude, JsonPropertyName("allow_custom_routing")] + public bool? AllowCustomRouting { get; init; } + + /// + /// Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1. + /// + [JsonInclude, JsonPropertyName("generation")] + public int Generation { get; init; } + + /// + /// If `true`, the data stream is hidden. + /// + [JsonInclude, JsonPropertyName("hidden")] + public bool Hidden { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("ilm_policy")] + public string? IlmPolicy { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + + /// + /// Contains the configuration for the data lifecycle management of this data stream. + /// + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycleWithRollover? Lifecycle { get; init; } + + /// + /// Name of the data stream. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// 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. + /// + [JsonInclude, JsonPropertyName("replicated")] + public bool? Replicated { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } + + /// + /// If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction. + /// + [JsonInclude, JsonPropertyName("system")] + public bool? System { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("template")] + public string Template { get; init; } + + /// + /// Information about the `@timestamp` field in the data stream. + /// + [JsonInclude, JsonPropertyName("timestamp_field")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamTimestampField TimestampField { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs new file mode 100644 index 00000000000..6ddc93885f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataStreamIndex +{ + /// + /// Name of the backing index. + /// + [JsonInclude, JsonPropertyName("index_name")] + public string IndexName { get; init; } + + /// + /// Universally unique identifier (UUID) for the index. + /// + [JsonInclude, JsonPropertyName("index_uuid")] + public string IndexUuid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs new file mode 100644 index 00000000000..8c1e85d2b17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataStreamLifecycle +{ + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? Lifecycle { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs new file mode 100644 index 00000000000..c1c73707383 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataStreamTimestampField +{ + /// + /// 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. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs new file mode 100644 index 00000000000..8c923b3233a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DataStreamVisibility +{ + [JsonInclude, JsonPropertyName("hidden")] + public bool? Hidden { get; set; } +} + +public sealed partial class DataStreamVisibilityDescriptor : SerializableDescriptor +{ + internal DataStreamVisibilityDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamVisibilityDescriptor() : base() + { + } + + private bool? HiddenValue { get; set; } + + public DataStreamVisibilityDescriptor Hidden(bool? hidden = true) + { + HiddenValue = hidden; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HiddenValue.HasValue) + { + writer.WritePropertyName("hidden"); + writer.WriteBooleanValue(HiddenValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DlmRolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DlmRolloverConditions.g.cs new file mode 100644 index 00000000000..5deaddd1d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DlmRolloverConditions.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class DlmRolloverConditions +{ + [JsonInclude, JsonPropertyName("max_age")] + public string? MaxAge { get; init; } + [JsonInclude, JsonPropertyName("max_docs")] + public long? MaxDocs { get; init; } + [JsonInclude, JsonPropertyName("max_primary_shard_docs")] + public long? MaxPrimaryShardDocs { get; init; } + [JsonInclude, JsonPropertyName("max_primary_shard_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSize { get; init; } + [JsonInclude, JsonPropertyName("max_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSize { get; init; } + [JsonInclude, JsonPropertyName("min_age")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MinAge { get; init; } + [JsonInclude, JsonPropertyName("min_docs")] + public long? MinDocs { get; init; } + [JsonInclude, JsonPropertyName("min_primary_shard_docs")] + public long? MinPrimaryShardDocs { get; init; } + [JsonInclude, JsonPropertyName("min_primary_shard_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinPrimaryShardSize { get; init; } + [JsonInclude, JsonPropertyName("min_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs new file mode 100644 index 00000000000..aa27b4ca978 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class FielddataFrequencyFilter +{ + [JsonInclude, JsonPropertyName("max")] + public double Max { get; set; } + [JsonInclude, JsonPropertyName("min")] + public double Min { get; set; } + [JsonInclude, JsonPropertyName("min_segment_size")] + public int MinSegmentSize { get; set; } +} + +public sealed partial class FielddataFrequencyFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FielddataFrequencyFilterDescriptor(Action configure) => configure.Invoke(this); + + public FielddataFrequencyFilterDescriptor() : base() + { + } + + private double MaxValue { get; set; } + private double MinValue { get; set; } + private int MinSegmentSizeValue { get; set; } + + public FielddataFrequencyFilterDescriptor Max(double max) + { + MaxValue = max; + return Self; + } + + public FielddataFrequencyFilterDescriptor Min(double min) + { + MinValue = min; + return Self; + } + + public FielddataFrequencyFilterDescriptor MinSegmentSize(int minSegmentSize) + { + MinSegmentSizeValue = minSegmentSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max"); + writer.WriteNumberValue(MaxValue); + writer.WritePropertyName("min"); + writer.WriteNumberValue(MinValue); + writer.WritePropertyName("min_segment_size"); + writer.WriteNumberValue(MinSegmentSizeValue); + writer.WriteEndObject(); + } + + FielddataFrequencyFilter IBuildableDescriptor.Build() => new() + { + Max = MaxValue, + Min = MinValue, + MinSegmentSize = MinSegmentSizeValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAliases.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAliases.g.cs new file mode 100644 index 00000000000..48b0d559502 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAliases.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexAliases +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyDictionary Aliases { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs new file mode 100644 index 00000000000..5f4a17ad5b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexMappingRecord +{ + [JsonInclude, JsonPropertyName("item")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Item { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping Mappings { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs new file mode 100644 index 00000000000..b4e708a5b59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRouting +{ + [JsonInclude, JsonPropertyName("allocation")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocation? Allocation { get; set; } + [JsonInclude, JsonPropertyName("rebalance")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalance? Rebalance { get; set; } +} + +public sealed partial class IndexRoutingDescriptor : SerializableDescriptor +{ + internal IndexRoutingDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocation? AllocationValue { get; set; } + private IndexRoutingAllocationDescriptor AllocationDescriptor { get; set; } + private Action AllocationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalance? RebalanceValue { get; set; } + private IndexRoutingRebalanceDescriptor RebalanceDescriptor { get; set; } + private Action RebalanceDescriptorAction { get; set; } + + public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocation? allocation) + { + AllocationDescriptor = null; + AllocationDescriptorAction = null; + AllocationValue = allocation; + return Self; + } + + public IndexRoutingDescriptor Allocation(IndexRoutingAllocationDescriptor descriptor) + { + AllocationValue = null; + AllocationDescriptorAction = null; + AllocationDescriptor = descriptor; + return Self; + } + + public IndexRoutingDescriptor Allocation(Action configure) + { + AllocationValue = null; + AllocationDescriptor = null; + AllocationDescriptorAction = configure; + return Self; + } + + public IndexRoutingDescriptor Rebalance(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalance? rebalance) + { + RebalanceDescriptor = null; + RebalanceDescriptorAction = null; + RebalanceValue = rebalance; + return Self; + } + + public IndexRoutingDescriptor Rebalance(IndexRoutingRebalanceDescriptor descriptor) + { + RebalanceValue = null; + RebalanceDescriptorAction = null; + RebalanceDescriptor = descriptor; + return Self; + } + + public IndexRoutingDescriptor Rebalance(Action configure) + { + RebalanceValue = null; + RebalanceDescriptor = null; + RebalanceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllocationDescriptor is not null) + { + writer.WritePropertyName("allocation"); + JsonSerializer.Serialize(writer, AllocationDescriptor, options); + } + else if (AllocationDescriptorAction is not null) + { + writer.WritePropertyName("allocation"); + JsonSerializer.Serialize(writer, new IndexRoutingAllocationDescriptor(AllocationDescriptorAction), options); + } + else if (AllocationValue is not null) + { + writer.WritePropertyName("allocation"); + JsonSerializer.Serialize(writer, AllocationValue, options); + } + + if (RebalanceDescriptor is not null) + { + writer.WritePropertyName("rebalance"); + JsonSerializer.Serialize(writer, RebalanceDescriptor, options); + } + else if (RebalanceDescriptorAction is not null) + { + writer.WritePropertyName("rebalance"); + JsonSerializer.Serialize(writer, new IndexRoutingRebalanceDescriptor(RebalanceDescriptorAction), options); + } + else if (RebalanceValue is not null) + { + writer.WritePropertyName("rebalance"); + JsonSerializer.Serialize(writer, RebalanceValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs new file mode 100644 index 00000000000..64a5d4cc6f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRoutingAllocation +{ + [JsonInclude, JsonPropertyName("disk")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDisk? Disk { get; set; } + [JsonInclude, JsonPropertyName("enable")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationOptions? Enable { get; set; } + [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInclude? Include { get; set; } + [JsonInclude, JsonPropertyName("initial_recovery")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecovery? InitialRecovery { get; set; } +} + +public sealed partial class IndexRoutingAllocationDescriptor : SerializableDescriptor +{ + internal IndexRoutingAllocationDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingAllocationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDisk? DiskValue { get; set; } + private IndexRoutingAllocationDiskDescriptor DiskDescriptor { get; set; } + private Action DiskDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationOptions? EnableValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInclude? IncludeValue { get; set; } + private IndexRoutingAllocationIncludeDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecovery? InitialRecoveryValue { get; set; } + private IndexRoutingAllocationInitialRecoveryDescriptor InitialRecoveryDescriptor { get; set; } + private Action InitialRecoveryDescriptorAction { get; set; } + + public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDisk? disk) + { + DiskDescriptor = null; + DiskDescriptorAction = null; + DiskValue = disk; + return Self; + } + + public IndexRoutingAllocationDescriptor Disk(IndexRoutingAllocationDiskDescriptor descriptor) + { + DiskValue = null; + DiskDescriptorAction = null; + DiskDescriptor = descriptor; + return Self; + } + + public IndexRoutingAllocationDescriptor Disk(Action configure) + { + DiskValue = null; + DiskDescriptor = null; + DiskDescriptorAction = configure; + return Self; + } + + public IndexRoutingAllocationDescriptor Enable(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationOptions? enable) + { + EnableValue = enable; + return Self; + } + + public IndexRoutingAllocationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInclude? include) + { + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeValue = include; + return Self; + } + + public IndexRoutingAllocationDescriptor Include(IndexRoutingAllocationIncludeDescriptor descriptor) + { + IncludeValue = null; + IncludeDescriptorAction = null; + IncludeDescriptor = descriptor; + return Self; + } + + public IndexRoutingAllocationDescriptor Include(Action configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorAction = configure; + return Self; + } + + public IndexRoutingAllocationDescriptor InitialRecovery(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecovery? initialRecovery) + { + InitialRecoveryDescriptor = null; + InitialRecoveryDescriptorAction = null; + InitialRecoveryValue = initialRecovery; + return Self; + } + + public IndexRoutingAllocationDescriptor InitialRecovery(IndexRoutingAllocationInitialRecoveryDescriptor descriptor) + { + InitialRecoveryValue = null; + InitialRecoveryDescriptorAction = null; + InitialRecoveryDescriptor = descriptor; + return Self; + } + + public IndexRoutingAllocationDescriptor InitialRecovery(Action configure) + { + InitialRecoveryValue = null; + InitialRecoveryDescriptor = null; + InitialRecoveryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DiskDescriptor is not null) + { + writer.WritePropertyName("disk"); + JsonSerializer.Serialize(writer, DiskDescriptor, options); + } + else if (DiskDescriptorAction is not null) + { + writer.WritePropertyName("disk"); + JsonSerializer.Serialize(writer, new IndexRoutingAllocationDiskDescriptor(DiskDescriptorAction), options); + } + else if (DiskValue is not null) + { + writer.WritePropertyName("disk"); + JsonSerializer.Serialize(writer, DiskValue, options); + } + + if (EnableValue is not null) + { + writer.WritePropertyName("enable"); + JsonSerializer.Serialize(writer, EnableValue, options); + } + + if (IncludeDescriptor is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeDescriptor, options); + } + else if (IncludeDescriptorAction is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, new IndexRoutingAllocationIncludeDescriptor(IncludeDescriptorAction), options); + } + else if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (InitialRecoveryDescriptor is not null) + { + writer.WritePropertyName("initial_recovery"); + JsonSerializer.Serialize(writer, InitialRecoveryDescriptor, options); + } + else if (InitialRecoveryDescriptorAction is not null) + { + writer.WritePropertyName("initial_recovery"); + JsonSerializer.Serialize(writer, new IndexRoutingAllocationInitialRecoveryDescriptor(InitialRecoveryDescriptorAction), options); + } + else if (InitialRecoveryValue is not null) + { + writer.WritePropertyName("initial_recovery"); + JsonSerializer.Serialize(writer, InitialRecoveryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs new file mode 100644 index 00000000000..2bd85f168bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRoutingAllocationDisk +{ + [JsonInclude, JsonPropertyName("threshold_enabled")] + public Union? ThresholdEnabled { get; set; } +} + +public sealed partial class IndexRoutingAllocationDiskDescriptor : SerializableDescriptor +{ + internal IndexRoutingAllocationDiskDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingAllocationDiskDescriptor() : base() + { + } + + private Union? ThresholdEnabledValue { get; set; } + + public IndexRoutingAllocationDiskDescriptor ThresholdEnabled(Union? thresholdEnabled) + { + ThresholdEnabledValue = thresholdEnabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ThresholdEnabledValue is not null) + { + writer.WritePropertyName("threshold_enabled"); + JsonSerializer.Serialize(writer, ThresholdEnabledValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs new file mode 100644 index 00000000000..f89a2bc0c32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRoutingAllocationInclude +{ + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + [JsonInclude, JsonPropertyName("_tier_preference")] + public string? TierPreference { get; set; } +} + +public sealed partial class IndexRoutingAllocationIncludeDescriptor : SerializableDescriptor +{ + internal IndexRoutingAllocationIncludeDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingAllocationIncludeDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private string? TierPreferenceValue { get; set; } + + public IndexRoutingAllocationIncludeDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + public IndexRoutingAllocationIncludeDescriptor TierPreference(string? tierPreference) + { + TierPreferenceValue = tierPreference; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (!string.IsNullOrEmpty(TierPreferenceValue)) + { + writer.WritePropertyName("_tier_preference"); + writer.WriteStringValue(TierPreferenceValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs new file mode 100644 index 00000000000..f70915a1352 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRoutingAllocationInitialRecovery +{ + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } +} + +public sealed partial class IndexRoutingAllocationInitialRecoveryDescriptor : SerializableDescriptor +{ + internal IndexRoutingAllocationInitialRecoveryDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingAllocationInitialRecoveryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + + public IndexRoutingAllocationInitialRecoveryDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs new file mode 100644 index 00000000000..b68031e40fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexRoutingRebalance +{ + [JsonInclude, JsonPropertyName("enable")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceOptions Enable { get; set; } +} + +public sealed partial class IndexRoutingRebalanceDescriptor : SerializableDescriptor +{ + internal IndexRoutingRebalanceDescriptor(Action configure) => configure.Invoke(this); + + public IndexRoutingRebalanceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceOptions EnableValue { get; set; } + + public IndexRoutingRebalanceDescriptor Enable(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceOptions enable) + { + EnableValue = enable; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enable"); + JsonSerializer.Serialize(writer, EnableValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs new file mode 100644 index 00000000000..549d66a5f79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs @@ -0,0 +1,176 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSegmentSort +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Field { get; set; } + [JsonInclude, JsonPropertyName("missing"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SegmentSortMissing))] + public ICollection? Missing { get; set; } + [JsonInclude, JsonPropertyName("mode"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SegmentSortMode))] + public ICollection? Mode { get; set; } + [JsonInclude, JsonPropertyName("order"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SegmentSortOrder))] + public ICollection? Order { get; set; } +} + +public sealed partial class IndexSegmentSortDescriptor : SerializableDescriptor> +{ + internal IndexSegmentSortDescriptor(Action> configure) => configure.Invoke(this); + + public IndexSegmentSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldValue { get; set; } + private ICollection? MissingValue { get; set; } + private ICollection? ModeValue { get; set; } + private ICollection? OrderValue { get; set; } + + public IndexSegmentSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Fields? field) + { + FieldValue = field; + return Self; + } + + public IndexSegmentSortDescriptor Missing(ICollection? missing) + { + MissingValue = missing; + return Self; + } + + public IndexSegmentSortDescriptor Mode(ICollection? mode) + { + ModeValue = mode; + return Self; + } + + public IndexSegmentSortDescriptor Order(ICollection? order) + { + OrderValue = order; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + SingleOrManySerializationHelper.Serialize(MissingValue, writer, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + SingleOrManySerializationHelper.Serialize(ModeValue, writer, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize(OrderValue, writer, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexSegmentSortDescriptor : SerializableDescriptor +{ + internal IndexSegmentSortDescriptor(Action configure) => configure.Invoke(this); + + public IndexSegmentSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldValue { get; set; } + private ICollection? MissingValue { get; set; } + private ICollection? ModeValue { get; set; } + private ICollection? OrderValue { get; set; } + + public IndexSegmentSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Fields? field) + { + FieldValue = field; + return Self; + } + + public IndexSegmentSortDescriptor Missing(ICollection? missing) + { + MissingValue = missing; + return Self; + } + + public IndexSegmentSortDescriptor Mode(ICollection? mode) + { + ModeValue = mode; + return Self; + } + + public IndexSegmentSortDescriptor Order(ICollection? order) + { + OrderValue = order; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + SingleOrManySerializationHelper.Serialize(MissingValue, writer, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + SingleOrManySerializationHelper.Serialize(ModeValue, writer, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + SingleOrManySerializationHelper.Serialize(OrderValue, writer, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs new file mode 100644 index 00000000000..f15259fdeb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs @@ -0,0 +1,128 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSettingBlocks +{ + [JsonInclude, JsonPropertyName("metadata")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? Metadata { get; set; } + [JsonInclude, JsonPropertyName("read")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? Read { get; set; } + [JsonInclude, JsonPropertyName("read_only")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? ReadOnly { get; set; } + [JsonInclude, JsonPropertyName("read_only_allow_delete")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? ReadOnlyAllowDelete { get; set; } + [JsonInclude, JsonPropertyName("write")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? Write { get; set; } +} + +public sealed partial class IndexSettingBlocksDescriptor : SerializableDescriptor +{ + internal IndexSettingBlocksDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingBlocksDescriptor() : base() + { + } + + private bool? MetadataValue { get; set; } + private bool? ReadValue { get; set; } + private bool? ReadOnlyValue { get; set; } + private bool? ReadOnlyAllowDeleteValue { get; set; } + private bool? WriteValue { get; set; } + + public IndexSettingBlocksDescriptor Metadata(bool? metadata = true) + { + MetadataValue = metadata; + return Self; + } + + public IndexSettingBlocksDescriptor Read(bool? read = true) + { + ReadValue = read; + return Self; + } + + public IndexSettingBlocksDescriptor ReadOnly(bool? readOnly = true) + { + ReadOnlyValue = readOnly; + return Self; + } + + public IndexSettingBlocksDescriptor ReadOnlyAllowDelete(bool? readOnlyAllowDelete = true) + { + ReadOnlyAllowDeleteValue = readOnlyAllowDelete; + return Self; + } + + public IndexSettingBlocksDescriptor Write(bool? write = true) + { + WriteValue = write; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (ReadValue is not null) + { + writer.WritePropertyName("read"); + JsonSerializer.Serialize(writer, ReadValue, options); + } + + if (ReadOnlyValue is not null) + { + writer.WritePropertyName("read_only"); + JsonSerializer.Serialize(writer, ReadOnlyValue, options); + } + + if (ReadOnlyAllowDeleteValue is not null) + { + writer.WritePropertyName("read_only_allow_delete"); + JsonSerializer.Serialize(writer, ReadOnlyAllowDeleteValue, options); + } + + if (WriteValue is not null) + { + writer.WritePropertyName("write"); + JsonSerializer.Serialize(writer, WriteValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs new file mode 100644 index 00000000000..aa1e809f7dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs @@ -0,0 +1,3732 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +internal sealed partial class IndexSettingsConverter : JsonConverter +{ + public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new IndexSettings(); + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "analysis") + { + variant.Analysis = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "analyze") + { + variant.Analyze = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "auto_expand_replicas") + { + variant.AutoExpandReplicas = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "blocks") + { + variant.Blocks = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "check_on_startup") + { + variant.CheckOnStartup = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "codec") + { + variant.Codec = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "creation_date") + { + variant.CreationDate = StringifiedLongConverter.ReadStringifiedLong(ref reader); + continue; + } + + if (property == "creation_date_string") + { + variant.CreationDateString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "default_pipeline") + { + variant.DefaultPipeline = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "final_pipeline") + { + variant.FinalPipeline = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "format") + { + variant.Format = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "gc_deletes") + { + variant.GcDeletes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "hidden") + { + variant.Hidden = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "highlight") + { + variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "index") + { + variant.Index = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indexing_pressure") + { + variant.IndexingPressure = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indexing.slowlog") + { + variant.IndexingSlowlog = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lifecycle") + { + variant.Lifecycle = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "load_fixed_bitset_filters_eagerly") + { + variant.LoadFixedBitsetFiltersEagerly = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "mapping") + { + variant.Mapping = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_docvalue_fields_search") + { + variant.MaxDocvalueFieldsSearch = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_inner_result_window") + { + variant.MaxInnerResultWindow = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_ngram_diff") + { + variant.MaxNgramDiff = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_refresh_listeners") + { + variant.MaxRefreshListeners = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_regex_length") + { + variant.MaxRegexLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_rescore_window") + { + variant.MaxRescoreWindow = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_result_window") + { + variant.MaxResultWindow = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_script_fields") + { + variant.MaxScriptFields = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_shingle_diff") + { + variant.MaxShingleDiff = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_slices_per_scroll") + { + variant.MaxSlicesPerScroll = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_terms_count") + { + variant.MaxTermsCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "merge") + { + variant.Merge = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "mode") + { + variant.Mode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "number_of_replicas") + { + variant.NumberOfReplicas = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "number_of_routing_shards") + { + variant.NumberOfRoutingShards = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "number_of_shards") + { + variant.NumberOfShards = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "priority") + { + variant.Priority = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "provided_name") + { + variant.ProvidedName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "queries") + { + variant.Queries = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_string") + { + variant.QueryString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "refresh_interval") + { + variant.RefreshInterval = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "routing") + { + variant.Routing = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "routing_partition_size") + { + variant.RoutingPartitionSize = StringifiedIntegerConverter.ReadStringifiedInteger(ref reader); + continue; + } + + if (property == "routing_path") + { + variant.RoutingPath = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "search") + { + variant.Search = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "settings") + { + variant.Settings = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "shards") + { + variant.Shards = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "similarity") + { + variant.Similarity = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_deletes") + { + variant.SoftDeletes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "sort") + { + variant.Sort = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "store") + { + variant.Store = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "time_series") + { + variant.TimeSeries = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "top_metrics_max_size") + { + variant.TopMetricsMaxSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "translog") + { + variant.Translog = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "uuid") + { + variant.Uuid = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "verified_before_close") + { + variant.VerifiedBeforeClose = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var value = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, value); + } + } + + variant.OtherSettings = additionalProperties; + return variant; + } + + public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.OtherSettings != null) + { + foreach (var additionalProperty in value.OtherSettings) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + if (value.Analysis is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, value.Analysis, options); + } + + if (value.Analyze is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, value.Analyze, options); + } + + if (!string.IsNullOrEmpty(value.AutoExpandReplicas)) + { + writer.WritePropertyName("auto_expand_replicas"); + writer.WriteStringValue(value.AutoExpandReplicas); + } + + if (value.Blocks is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, value.Blocks, options); + } + + if (value.CheckOnStartup is not null) + { + writer.WritePropertyName("check_on_startup"); + JsonSerializer.Serialize(writer, value.CheckOnStartup, options); + } + + if (!string.IsNullOrEmpty(value.Codec)) + { + writer.WritePropertyName("codec"); + writer.WriteStringValue(value.Codec); + } + + if (value.CreationDate is not null) + { + writer.WritePropertyName("creation_date"); + JsonSerializer.Serialize(writer, value.CreationDate, options); + } + + if (value.CreationDateString is not null) + { + writer.WritePropertyName("creation_date_string"); + JsonSerializer.Serialize(writer, value.CreationDateString, options); + } + + if (value.DefaultPipeline is not null) + { + writer.WritePropertyName("default_pipeline"); + JsonSerializer.Serialize(writer, value.DefaultPipeline, options); + } + + if (value.FinalPipeline is not null) + { + writer.WritePropertyName("final_pipeline"); + JsonSerializer.Serialize(writer, value.FinalPipeline, options); + } + + if (value.Format is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, value.Format, options); + } + + if (value.GcDeletes is not null) + { + writer.WritePropertyName("gc_deletes"); + JsonSerializer.Serialize(writer, value.GcDeletes, options); + } + + if (value.Hidden is not null) + { + writer.WritePropertyName("hidden"); + JsonSerializer.Serialize(writer, value.Hidden, options); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.Index is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, value.Index, options); + } + + if (value.IndexingPressure is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, value.IndexingPressure, options); + } + + if (value.IndexingSlowlog is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, value.IndexingSlowlog, options); + } + + if (value.Lifecycle is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, value.Lifecycle, options); + } + + if (value.LoadFixedBitsetFiltersEagerly.HasValue) + { + writer.WritePropertyName("load_fixed_bitset_filters_eagerly"); + writer.WriteBooleanValue(value.LoadFixedBitsetFiltersEagerly.Value); + } + + if (value.Mapping is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, value.Mapping, options); + } + + if (value.MaxDocvalueFieldsSearch.HasValue) + { + writer.WritePropertyName("max_docvalue_fields_search"); + writer.WriteNumberValue(value.MaxDocvalueFieldsSearch.Value); + } + + if (value.MaxInnerResultWindow.HasValue) + { + writer.WritePropertyName("max_inner_result_window"); + writer.WriteNumberValue(value.MaxInnerResultWindow.Value); + } + + if (value.MaxNgramDiff.HasValue) + { + writer.WritePropertyName("max_ngram_diff"); + writer.WriteNumberValue(value.MaxNgramDiff.Value); + } + + if (value.MaxRefreshListeners.HasValue) + { + writer.WritePropertyName("max_refresh_listeners"); + writer.WriteNumberValue(value.MaxRefreshListeners.Value); + } + + if (value.MaxRegexLength.HasValue) + { + writer.WritePropertyName("max_regex_length"); + writer.WriteNumberValue(value.MaxRegexLength.Value); + } + + if (value.MaxRescoreWindow.HasValue) + { + writer.WritePropertyName("max_rescore_window"); + writer.WriteNumberValue(value.MaxRescoreWindow.Value); + } + + if (value.MaxResultWindow.HasValue) + { + writer.WritePropertyName("max_result_window"); + writer.WriteNumberValue(value.MaxResultWindow.Value); + } + + if (value.MaxScriptFields.HasValue) + { + writer.WritePropertyName("max_script_fields"); + writer.WriteNumberValue(value.MaxScriptFields.Value); + } + + if (value.MaxShingleDiff.HasValue) + { + writer.WritePropertyName("max_shingle_diff"); + writer.WriteNumberValue(value.MaxShingleDiff.Value); + } + + if (value.MaxSlicesPerScroll.HasValue) + { + writer.WritePropertyName("max_slices_per_scroll"); + writer.WriteNumberValue(value.MaxSlicesPerScroll.Value); + } + + if (value.MaxTermsCount.HasValue) + { + writer.WritePropertyName("max_terms_count"); + writer.WriteNumberValue(value.MaxTermsCount.Value); + } + + if (value.Merge is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, value.Merge, options); + } + + if (!string.IsNullOrEmpty(value.Mode)) + { + writer.WritePropertyName("mode"); + writer.WriteStringValue(value.Mode); + } + + if (value.NumberOfReplicas is not null) + { + writer.WritePropertyName("number_of_replicas"); + JsonSerializer.Serialize(writer, value.NumberOfReplicas, options); + } + + if (value.NumberOfRoutingShards.HasValue) + { + writer.WritePropertyName("number_of_routing_shards"); + writer.WriteNumberValue(value.NumberOfRoutingShards.Value); + } + + if (value.NumberOfShards is not null) + { + writer.WritePropertyName("number_of_shards"); + JsonSerializer.Serialize(writer, value.NumberOfShards, options); + } + + if (value.Priority is not null) + { + writer.WritePropertyName("priority"); + JsonSerializer.Serialize(writer, value.Priority, options); + } + + if (value.ProvidedName is not null) + { + writer.WritePropertyName("provided_name"); + JsonSerializer.Serialize(writer, value.ProvidedName, options); + } + + if (value.Queries is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, value.Queries, options); + } + + if (value.QueryString is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, value.QueryString, options); + } + + if (value.RefreshInterval is not null) + { + writer.WritePropertyName("refresh_interval"); + JsonSerializer.Serialize(writer, value.RefreshInterval, options); + } + + if (value.Routing is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, value.Routing, options); + } + + if (value.RoutingPartitionSize is not null) + { + writer.WritePropertyName("routing_partition_size"); + JsonSerializer.Serialize(writer, value.RoutingPartitionSize, options); + } + + if (value.RoutingPath is not null) + { + writer.WritePropertyName("routing_path"); + JsonSerializer.Serialize(writer, value.RoutingPath, options); + } + + if (value.Search is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, value.Search, options); + } + + if (value.Settings is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, value.Settings, options); + } + + if (value.Shards.HasValue) + { + writer.WritePropertyName("shards"); + writer.WriteNumberValue(value.Shards.Value); + } + + if (value.Similarity is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, value.Similarity, options); + } + + if (value.SoftDeletes is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, value.SoftDeletes, options); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + } + + if (value.Store is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, value.Store, options); + } + + if (value.TimeSeries is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, value.TimeSeries, options); + } + + if (value.TopMetricsMaxSize.HasValue) + { + writer.WritePropertyName("top_metrics_max_size"); + writer.WriteNumberValue(value.TopMetricsMaxSize.Value); + } + + if (value.Translog is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, value.Translog, options); + } + + if (value.Uuid is not null) + { + writer.WritePropertyName("uuid"); + JsonSerializer.Serialize(writer, value.Uuid, options); + } + + if (value.VerifiedBeforeClose is not null) + { + writer.WritePropertyName("verified_before_close"); + JsonSerializer.Serialize(writer, value.VerifiedBeforeClose, options); + } + + if (value.Version is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, value.Version, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(IndexSettingsConverter))] +public sealed partial class IndexSettings +{ + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? Analysis { get; set; } + + /// + /// Settings to define analyzers, tokenizers, token filters and character filters. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyze? Analyze { get; set; } + public string? AutoExpandReplicas { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocks? Blocks { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexCheckOnStartup? CheckOnStartup { get; set; } + public string? Codec { get; set; } + [JsonConverter(typeof(StringifiedLongConverter))] + public long? CreationDate { get; set; } + public DateTimeOffset? CreationDateString { get; set; } + public string? DefaultPipeline { get; set; } + public string? FinalPipeline { get; set; } + public Union? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletes { get; set; } + public Union? Hidden { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? Highlight { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Index { get; set; } + + /// + /// Configure indexing back pressure limits. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressure? IndexingPressure { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettings? IndexingSlowlog { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycle? Lifecycle { get; set; } + public bool? LoadFixedBitsetFiltersEagerly { get; set; } + + /// + /// Enable or disable dynamic mapping for an index. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettings? Mapping { get; set; } + public int? MaxDocvalueFieldsSearch { get; set; } + public int? MaxInnerResultWindow { get; set; } + public int? MaxNgramDiff { get; set; } + public int? MaxRefreshListeners { get; set; } + public int? MaxRegexLength { get; set; } + public int? MaxRescoreWindow { get; set; } + public int? MaxResultWindow { get; set; } + public int? MaxScriptFields { get; set; } + public int? MaxShingleDiff { get; set; } + public int? MaxSlicesPerScroll { get; set; } + public int? MaxTermsCount { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Merge? Merge { get; set; } + public string? Mode { get; set; } + public Union? NumberOfReplicas { get; set; } + public int? NumberOfRoutingShards { get; set; } + public Union? NumberOfShards { get; set; } + public IDictionary OtherSettings { get; set; } + public Union? Priority { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Name? ProvidedName { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Queries? Queries { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryString? QueryString { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? RefreshInterval { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? Routing { get; set; } + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int? RoutingPartitionSize { get; set; } + public ICollection? RoutingPath { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearch? Search { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } + public int? Shards { get; set; } + + /// + /// Configure custom similarity settings to customize how search results are scored. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? Similarity { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? SoftDeletes { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? Sort { get; set; } + + /// + /// The store module allows you to control how index data is stored and accessed on disk. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Storage? Store { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeries? TimeSeries { get; set; } + public int? TopMetricsMaxSize { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Translog? Translog { get; set; } + public string? Uuid { get; set; } + public Union? VerifiedBeforeClose { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? Version { get; set; } +} + +public sealed partial class IndexSettingsDescriptor : SerializableDescriptor> +{ + internal IndexSettingsDescriptor(Action> configure) => configure.Invoke(this); + + public IndexSettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? IndexValue { get; set; } + private IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action> IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? SortValue { get; set; } + private IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? AnalysisValue { get; set; } + private IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyze? AnalyzeValue { get; set; } + private SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } + private Action AnalyzeDescriptorAction { get; set; } + private string? AutoExpandReplicasValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocks? BlocksValue { get; set; } + private IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } + private Action BlocksDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexCheckOnStartup? CheckOnStartupValue { get; set; } + private string? CodecValue { get; set; } + private long? CreationDateValue { get; set; } + private DateTimeOffset? CreationDateStringValue { get; set; } + private string? DefaultPipelineValue { get; set; } + private string? FinalPipelineValue { get; set; } + private Union? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletesValue { get; set; } + private Union? HiddenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? HighlightValue { get; set; } + private SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } + private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } + private Action IndexingPressureDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } + private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } + private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private bool? LoadFixedBitsetFiltersEagerlyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettings? MappingValue { get; set; } + private MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } + private int? MaxDocvalueFieldsSearchValue { get; set; } + private int? MaxInnerResultWindowValue { get; set; } + private int? MaxNgramDiffValue { get; set; } + private int? MaxRefreshListenersValue { get; set; } + private int? MaxRegexLengthValue { get; set; } + private int? MaxRescoreWindowValue { get; set; } + private int? MaxResultWindowValue { get; set; } + private int? MaxScriptFieldsValue { get; set; } + private int? MaxShingleDiffValue { get; set; } + private int? MaxSlicesPerScrollValue { get; set; } + private int? MaxTermsCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Merge? MergeValue { get; set; } + private MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } + private string? ModeValue { get; set; } + private Union? NumberOfReplicasValue { get; set; } + private int? NumberOfRoutingShardsValue { get; set; } + private Union? NumberOfShardsValue { get; set; } + private IDictionary OtherSettingsValue { get; set; } + private Union? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? ProvidedNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Queries? QueriesValue { get; set; } + private QueriesDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryString? QueryStringValue { get; set; } + private SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } + private Action QueryStringDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? RefreshIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? RoutingValue { get; set; } + private IndexRoutingDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private int? RoutingPartitionSizeValue { get; set; } + private ICollection? RoutingPathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearch? SearchValue { get; set; } + private SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { get; set; } + private int? ShardsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? SimilarityValue { get; set; } + private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } + private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? SoftDeletesValue { get; set; } + private SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Storage? StoreValue { get; set; } + private StorageDescriptor StoreDescriptor { get; set; } + private Action StoreDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeries? TimeSeriesValue { get; set; } + private IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } + private Action TimeSeriesDescriptorAction { get; set; } + private int? TopMetricsMaxSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Translog? TranslogValue { get; set; } + private TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } + private string? UuidValue { get; set; } + private Union? VerifiedBeforeCloseValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? VersionValue { get; set; } + private IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } + + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? index) + { + IndexDescriptor = null; + IndexDescriptorAction = null; + IndexValue = index; + return Self; + } + + public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + { + IndexValue = null; + IndexDescriptorAction = null; + IndexDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Index(Action> configure) + { + IndexValue = null; + IndexDescriptor = null; + IndexDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortValue = sort; + return Self; + } + + public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Settings to define analyzers, tokenizers, token filters and character filters. + /// + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyze? analyze) + { + AnalyzeDescriptor = null; + AnalyzeDescriptorAction = null; + AnalyzeValue = analyze; + return Self; + } + + public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + { + AnalyzeValue = null; + AnalyzeDescriptorAction = null; + AnalyzeDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Analyze(Action configure) + { + AnalyzeValue = null; + AnalyzeDescriptor = null; + AnalyzeDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor AutoExpandReplicas(string? autoExpandReplicas) + { + AutoExpandReplicasValue = autoExpandReplicas; + return Self; + } + + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocks? blocks) + { + BlocksDescriptor = null; + BlocksDescriptorAction = null; + BlocksValue = blocks; + return Self; + } + + public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + { + BlocksValue = null; + BlocksDescriptorAction = null; + BlocksDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Blocks(Action configure) + { + BlocksValue = null; + BlocksDescriptor = null; + BlocksDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor CheckOnStartup(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexCheckOnStartup? checkOnStartup) + { + CheckOnStartupValue = checkOnStartup; + return Self; + } + + public IndexSettingsDescriptor Codec(string? codec) + { + CodecValue = codec; + return Self; + } + + public IndexSettingsDescriptor CreationDate(long? creationDate) + { + CreationDateValue = creationDate; + return Self; + } + + public IndexSettingsDescriptor CreationDateString(DateTimeOffset? creationDateString) + { + CreationDateStringValue = creationDateString; + return Self; + } + + public IndexSettingsDescriptor DefaultPipeline(string? defaultPipeline) + { + DefaultPipelineValue = defaultPipeline; + return Self; + } + + public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) + { + FinalPipelineValue = finalPipeline; + return Self; + } + + public IndexSettingsDescriptor Format(Union? format) + { + FormatValue = format; + return Self; + } + + public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearch.Serverless.Duration? gcDeletes) + { + GcDeletesValue = gcDeletes; + return Self; + } + + public IndexSettingsDescriptor Hidden(Union? hidden) + { + HiddenValue = hidden; + return Self; + } + + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Configure indexing back pressure limits. + /// + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressure? indexingPressure) + { + IndexingPressureDescriptor = null; + IndexingPressureDescriptorAction = null; + IndexingPressureValue = indexingPressure; + return Self; + } + + public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + { + IndexingPressureValue = null; + IndexingPressureDescriptorAction = null; + IndexingPressureDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor IndexingPressure(Action configure) + { + IndexingPressureValue = null; + IndexingPressureDescriptor = null; + IndexingPressureDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettings? indexingSlowlog) + { + IndexingSlowlogDescriptor = null; + IndexingSlowlogDescriptorAction = null; + IndexingSlowlogValue = indexingSlowlog; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + { + IndexingSlowlogValue = null; + IndexingSlowlogDescriptorAction = null; + IndexingSlowlogDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(Action configure) + { + IndexingSlowlogValue = null; + IndexingSlowlogDescriptor = null; + IndexingSlowlogDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor LoadFixedBitsetFiltersEagerly(bool? loadFixedBitsetFiltersEagerly = true) + { + LoadFixedBitsetFiltersEagerlyValue = loadFixedBitsetFiltersEagerly; + return Self; + } + + /// + /// Enable or disable dynamic mapping for an index. + /// + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettings? mapping) + { + MappingDescriptor = null; + MappingDescriptorAction = null; + MappingValue = mapping; + return Self; + } + + public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + { + MappingValue = null; + MappingDescriptorAction = null; + MappingDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Mapping(Action configure) + { + MappingValue = null; + MappingDescriptor = null; + MappingDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor MaxDocvalueFieldsSearch(int? maxDocvalueFieldsSearch) + { + MaxDocvalueFieldsSearchValue = maxDocvalueFieldsSearch; + return Self; + } + + public IndexSettingsDescriptor MaxInnerResultWindow(int? maxInnerResultWindow) + { + MaxInnerResultWindowValue = maxInnerResultWindow; + return Self; + } + + public IndexSettingsDescriptor MaxNgramDiff(int? maxNgramDiff) + { + MaxNgramDiffValue = maxNgramDiff; + return Self; + } + + public IndexSettingsDescriptor MaxRefreshListeners(int? maxRefreshListeners) + { + MaxRefreshListenersValue = maxRefreshListeners; + return Self; + } + + public IndexSettingsDescriptor MaxRegexLength(int? maxRegexLength) + { + MaxRegexLengthValue = maxRegexLength; + return Self; + } + + public IndexSettingsDescriptor MaxRescoreWindow(int? maxRescoreWindow) + { + MaxRescoreWindowValue = maxRescoreWindow; + return Self; + } + + public IndexSettingsDescriptor MaxResultWindow(int? maxResultWindow) + { + MaxResultWindowValue = maxResultWindow; + return Self; + } + + public IndexSettingsDescriptor MaxScriptFields(int? maxScriptFields) + { + MaxScriptFieldsValue = maxScriptFields; + return Self; + } + + public IndexSettingsDescriptor MaxShingleDiff(int? maxShingleDiff) + { + MaxShingleDiffValue = maxShingleDiff; + return Self; + } + + public IndexSettingsDescriptor MaxSlicesPerScroll(int? maxSlicesPerScroll) + { + MaxSlicesPerScrollValue = maxSlicesPerScroll; + return Self; + } + + public IndexSettingsDescriptor MaxTermsCount(int? maxTermsCount) + { + MaxTermsCountValue = maxTermsCount; + return Self; + } + + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Merge? merge) + { + MergeDescriptor = null; + MergeDescriptorAction = null; + MergeValue = merge; + return Self; + } + + public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + { + MergeValue = null; + MergeDescriptorAction = null; + MergeDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Merge(Action configure) + { + MergeValue = null; + MergeDescriptor = null; + MergeDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Mode(string? mode) + { + ModeValue = mode; + return Self; + } + + public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + { + NumberOfReplicasValue = numberOfReplicas; + return Self; + } + + public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRoutingShards) + { + NumberOfRoutingShardsValue = numberOfRoutingShards; + return Self; + } + + public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + { + NumberOfShardsValue = numberOfShards; + return Self; + } + + public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) + { + OtherSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexSettingsDescriptor Priority(Union? priority) + { + PriorityValue = priority; + return Self; + } + + public IndexSettingsDescriptor ProvidedName(Elastic.Clients.Elasticsearch.Serverless.Name? providedName) + { + ProvidedNameValue = providedName; + return Self; + } + + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Queries? queries) + { + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesValue = queries; + return Self; + } + + public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + { + QueriesValue = null; + QueriesDescriptorAction = null; + QueriesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Queries(Action configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryString? queryString) + { + QueryStringDescriptor = null; + QueryStringDescriptorAction = null; + QueryStringValue = queryString; + return Self; + } + + public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + { + QueryStringValue = null; + QueryStringDescriptorAction = null; + QueryStringDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor QueryString(Action configure) + { + QueryStringValue = null; + QueryStringDescriptor = null; + QueryStringDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor RefreshInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? refreshInterval) + { + RefreshIntervalValue = refreshInterval; + return Self; + } + + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor RoutingPartitionSize(int? routingPartitionSize) + { + RoutingPartitionSizeValue = routingPartitionSize; + return Self; + } + + public IndexSettingsDescriptor RoutingPath(ICollection? routingPath) + { + RoutingPathValue = routingPath; + return Self; + } + + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearch? search) + { + SearchDescriptor = null; + SearchDescriptorAction = null; + SearchValue = search; + return Self; + } + + public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + { + SearchValue = null; + SearchDescriptorAction = null; + SearchDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Search(Action configure) + { + SearchValue = null; + SearchDescriptor = null; + SearchDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Shards(int? shards) + { + ShardsValue = shards; + return Self; + } + + /// + /// Configure custom similarity settings to customize how search results are scored. + /// + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? similarity) + { + SimilarityDescriptor = null; + SimilarityDescriptorAction = null; + SimilarityValue = similarity; + return Self; + } + + public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + { + SimilarityValue = null; + SimilarityDescriptorAction = null; + SimilarityDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Similarity(Action configure) + { + SimilarityValue = null; + SimilarityDescriptor = null; + SimilarityDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? softDeletes) + { + SoftDeletesDescriptor = null; + SoftDeletesDescriptorAction = null; + SoftDeletesValue = softDeletes; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + { + SoftDeletesValue = null; + SoftDeletesDescriptorAction = null; + SoftDeletesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(Action configure) + { + SoftDeletesValue = null; + SoftDeletesDescriptor = null; + SoftDeletesDescriptorAction = configure; + return Self; + } + + /// + /// The store module allows you to control how index data is stored and accessed on disk. + /// + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Storage? store) + { + StoreDescriptor = null; + StoreDescriptorAction = null; + StoreValue = store; + return Self; + } + + public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + { + StoreValue = null; + StoreDescriptorAction = null; + StoreDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Store(Action configure) + { + StoreValue = null; + StoreDescriptor = null; + StoreDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeries? timeSeries) + { + TimeSeriesDescriptor = null; + TimeSeriesDescriptorAction = null; + TimeSeriesValue = timeSeries; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + { + TimeSeriesValue = null; + TimeSeriesDescriptorAction = null; + TimeSeriesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(Action configure) + { + TimeSeriesValue = null; + TimeSeriesDescriptor = null; + TimeSeriesDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor TopMetricsMaxSize(int? topMetricsMaxSize) + { + TopMetricsMaxSizeValue = topMetricsMaxSize; + return Self; + } + + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Translog? translog) + { + TranslogDescriptor = null; + TranslogDescriptorAction = null; + TranslogValue = translog; + return Self; + } + + public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + { + TranslogValue = null; + TranslogDescriptorAction = null; + TranslogDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Translog(Action configure) + { + TranslogValue = null; + TranslogDescriptor = null; + TranslogDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + { + VerifiedBeforeCloseValue = verifiedBeforeClose; + return Self; + } + + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? version) + { + VersionDescriptor = null; + VersionDescriptorAction = null; + VersionValue = version; + return Self; + } + + public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + { + VersionValue = null; + VersionDescriptorAction = null; + VersionDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Version(Action configure) + { + VersionValue = null; + VersionDescriptor = null; + VersionDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexDescriptor is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexDescriptor, options); + } + else if (IndexDescriptorAction is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + } + else if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (AnalysisDescriptor is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisDescriptor, options); + } + else if (AnalysisDescriptorAction is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzeDescriptor is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, AnalyzeDescriptor, options); + } + else if (AnalyzeDescriptorAction is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + } + else if (AnalyzeValue is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, AnalyzeValue, options); + } + + if (!string.IsNullOrEmpty(AutoExpandReplicasValue)) + { + writer.WritePropertyName("auto_expand_replicas"); + writer.WriteStringValue(AutoExpandReplicasValue); + } + + if (BlocksDescriptor is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, BlocksDescriptor, options); + } + else if (BlocksDescriptorAction is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + } + else if (BlocksValue is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, BlocksValue, options); + } + + if (CheckOnStartupValue is not null) + { + writer.WritePropertyName("check_on_startup"); + JsonSerializer.Serialize(writer, CheckOnStartupValue, options); + } + + if (!string.IsNullOrEmpty(CodecValue)) + { + writer.WritePropertyName("codec"); + writer.WriteStringValue(CodecValue); + } + + if (CreationDateValue is not null) + { + writer.WritePropertyName("creation_date"); + JsonSerializer.Serialize(writer, CreationDateValue, options); + } + + if (CreationDateStringValue is not null) + { + writer.WritePropertyName("creation_date_string"); + JsonSerializer.Serialize(writer, CreationDateStringValue, options); + } + + if (DefaultPipelineValue is not null) + { + writer.WritePropertyName("default_pipeline"); + JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + } + + if (FinalPipelineValue is not null) + { + writer.WritePropertyName("final_pipeline"); + JsonSerializer.Serialize(writer, FinalPipelineValue, options); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (GcDeletesValue is not null) + { + writer.WritePropertyName("gc_deletes"); + JsonSerializer.Serialize(writer, GcDeletesValue, options); + } + + if (HiddenValue is not null) + { + writer.WritePropertyName("hidden"); + JsonSerializer.Serialize(writer, HiddenValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (IndexingPressureDescriptor is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, IndexingPressureDescriptor, options); + } + else if (IndexingPressureDescriptorAction is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + } + else if (IndexingPressureValue is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, IndexingPressureValue, options); + } + + if (IndexingSlowlogDescriptor is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, IndexingSlowlogDescriptor, options); + } + else if (IndexingSlowlogDescriptorAction is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + } + else if (IndexingSlowlogValue is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, IndexingSlowlogValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + if (LoadFixedBitsetFiltersEagerlyValue.HasValue) + { + writer.WritePropertyName("load_fixed_bitset_filters_eagerly"); + writer.WriteBooleanValue(LoadFixedBitsetFiltersEagerlyValue.Value); + } + + if (MappingDescriptor is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, MappingDescriptor, options); + } + else if (MappingDescriptorAction is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + } + else if (MappingValue is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, MappingValue, options); + } + + if (MaxDocvalueFieldsSearchValue.HasValue) + { + writer.WritePropertyName("max_docvalue_fields_search"); + writer.WriteNumberValue(MaxDocvalueFieldsSearchValue.Value); + } + + if (MaxInnerResultWindowValue.HasValue) + { + writer.WritePropertyName("max_inner_result_window"); + writer.WriteNumberValue(MaxInnerResultWindowValue.Value); + } + + if (MaxNgramDiffValue.HasValue) + { + writer.WritePropertyName("max_ngram_diff"); + writer.WriteNumberValue(MaxNgramDiffValue.Value); + } + + if (MaxRefreshListenersValue.HasValue) + { + writer.WritePropertyName("max_refresh_listeners"); + writer.WriteNumberValue(MaxRefreshListenersValue.Value); + } + + if (MaxRegexLengthValue.HasValue) + { + writer.WritePropertyName("max_regex_length"); + writer.WriteNumberValue(MaxRegexLengthValue.Value); + } + + if (MaxRescoreWindowValue.HasValue) + { + writer.WritePropertyName("max_rescore_window"); + writer.WriteNumberValue(MaxRescoreWindowValue.Value); + } + + if (MaxResultWindowValue.HasValue) + { + writer.WritePropertyName("max_result_window"); + writer.WriteNumberValue(MaxResultWindowValue.Value); + } + + if (MaxScriptFieldsValue.HasValue) + { + writer.WritePropertyName("max_script_fields"); + writer.WriteNumberValue(MaxScriptFieldsValue.Value); + } + + if (MaxShingleDiffValue.HasValue) + { + writer.WritePropertyName("max_shingle_diff"); + writer.WriteNumberValue(MaxShingleDiffValue.Value); + } + + if (MaxSlicesPerScrollValue.HasValue) + { + writer.WritePropertyName("max_slices_per_scroll"); + writer.WriteNumberValue(MaxSlicesPerScrollValue.Value); + } + + if (MaxTermsCountValue.HasValue) + { + writer.WritePropertyName("max_terms_count"); + writer.WriteNumberValue(MaxTermsCountValue.Value); + } + + if (MergeDescriptor is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, MergeDescriptor, options); + } + else if (MergeDescriptorAction is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + } + else if (MergeValue is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, MergeValue, options); + } + + if (!string.IsNullOrEmpty(ModeValue)) + { + writer.WritePropertyName("mode"); + writer.WriteStringValue(ModeValue); + } + + if (NumberOfReplicasValue is not null) + { + writer.WritePropertyName("number_of_replicas"); + JsonSerializer.Serialize(writer, NumberOfReplicasValue, options); + } + + if (NumberOfRoutingShardsValue.HasValue) + { + writer.WritePropertyName("number_of_routing_shards"); + writer.WriteNumberValue(NumberOfRoutingShardsValue.Value); + } + + if (NumberOfShardsValue is not null) + { + writer.WritePropertyName("number_of_shards"); + JsonSerializer.Serialize(writer, NumberOfShardsValue, options); + } + + if (PriorityValue is not null) + { + writer.WritePropertyName("priority"); + JsonSerializer.Serialize(writer, PriorityValue, options); + } + + if (ProvidedNameValue is not null) + { + writer.WritePropertyName("provided_name"); + JsonSerializer.Serialize(writer, ProvidedNameValue, options); + } + + if (QueriesDescriptor is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesDescriptor, options); + } + else if (QueriesDescriptorAction is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + } + else if (QueriesValue is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesValue, options); + } + + if (QueryStringDescriptor is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, QueryStringDescriptor, options); + } + else if (QueryStringDescriptorAction is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + } + else if (QueryStringValue is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, QueryStringValue, options); + } + + if (RefreshIntervalValue is not null) + { + writer.WritePropertyName("refresh_interval"); + JsonSerializer.Serialize(writer, RefreshIntervalValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (RoutingPartitionSizeValue is not null) + { + writer.WritePropertyName("routing_partition_size"); + JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + } + + if (RoutingPathValue is not null) + { + writer.WritePropertyName("routing_path"); + SingleOrManySerializationHelper.Serialize(RoutingPathValue, writer, options); + } + + if (SearchDescriptor is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, SearchDescriptor, options); + } + else if (SearchDescriptorAction is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + } + else if (SearchValue is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, SearchValue, options); + } + + if (ShardsValue.HasValue) + { + writer.WritePropertyName("shards"); + writer.WriteNumberValue(ShardsValue.Value); + } + + if (SimilarityDescriptor is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, SimilarityDescriptor, options); + } + else if (SimilarityDescriptorAction is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, new SettingsSimilarityDescriptor(SimilarityDescriptorAction), options); + } + else if (SimilarityValue is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, SimilarityValue, options); + } + + if (SoftDeletesDescriptor is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, SoftDeletesDescriptor, options); + } + else if (SoftDeletesDescriptorAction is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + } + else if (SoftDeletesValue is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, SoftDeletesValue, options); + } + + if (StoreDescriptor is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, StoreDescriptor, options); + } + else if (StoreDescriptorAction is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + } + else if (StoreValue is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, StoreValue, options); + } + + if (TimeSeriesDescriptor is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, TimeSeriesDescriptor, options); + } + else if (TimeSeriesDescriptorAction is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + } + else if (TimeSeriesValue is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, TimeSeriesValue, options); + } + + if (TopMetricsMaxSizeValue.HasValue) + { + writer.WritePropertyName("top_metrics_max_size"); + writer.WriteNumberValue(TopMetricsMaxSizeValue.Value); + } + + if (TranslogDescriptor is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, TranslogDescriptor, options); + } + else if (TranslogDescriptorAction is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + } + else if (TranslogValue is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, TranslogValue, options); + } + + if (UuidValue is not null) + { + writer.WritePropertyName("uuid"); + JsonSerializer.Serialize(writer, UuidValue, options); + } + + if (VerifiedBeforeCloseValue is not null) + { + writer.WritePropertyName("verified_before_close"); + JsonSerializer.Serialize(writer, VerifiedBeforeCloseValue, options); + } + + if (VersionDescriptor is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionDescriptor, options); + } + else if (VersionDescriptorAction is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + } + else if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (OtherSettingsValue != null) + { + foreach (var additionalProperty in OtherSettingsValue) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexSettingsDescriptor : SerializableDescriptor +{ + internal IndexSettingsDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? IndexValue { get; set; } + private IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? SortValue { get; set; } + private IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? AnalysisValue { get; set; } + private IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyze? AnalyzeValue { get; set; } + private SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } + private Action AnalyzeDescriptorAction { get; set; } + private string? AutoExpandReplicasValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocks? BlocksValue { get; set; } + private IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } + private Action BlocksDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexCheckOnStartup? CheckOnStartupValue { get; set; } + private string? CodecValue { get; set; } + private long? CreationDateValue { get; set; } + private DateTimeOffset? CreationDateStringValue { get; set; } + private string? DefaultPipelineValue { get; set; } + private string? FinalPipelineValue { get; set; } + private Union? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletesValue { get; set; } + private Union? HiddenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? HighlightValue { get; set; } + private SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } + private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } + private Action IndexingPressureDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } + private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } + private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private bool? LoadFixedBitsetFiltersEagerlyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettings? MappingValue { get; set; } + private MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } + private int? MaxDocvalueFieldsSearchValue { get; set; } + private int? MaxInnerResultWindowValue { get; set; } + private int? MaxNgramDiffValue { get; set; } + private int? MaxRefreshListenersValue { get; set; } + private int? MaxRegexLengthValue { get; set; } + private int? MaxRescoreWindowValue { get; set; } + private int? MaxResultWindowValue { get; set; } + private int? MaxScriptFieldsValue { get; set; } + private int? MaxShingleDiffValue { get; set; } + private int? MaxSlicesPerScrollValue { get; set; } + private int? MaxTermsCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Merge? MergeValue { get; set; } + private MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } + private string? ModeValue { get; set; } + private Union? NumberOfReplicasValue { get; set; } + private int? NumberOfRoutingShardsValue { get; set; } + private Union? NumberOfShardsValue { get; set; } + private IDictionary OtherSettingsValue { get; set; } + private Union? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? ProvidedNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Queries? QueriesValue { get; set; } + private QueriesDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryString? QueryStringValue { get; set; } + private SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } + private Action QueryStringDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? RefreshIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? RoutingValue { get; set; } + private IndexRoutingDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private int? RoutingPartitionSizeValue { get; set; } + private ICollection? RoutingPathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearch? SearchValue { get; set; } + private SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { get; set; } + private int? ShardsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? SimilarityValue { get; set; } + private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } + private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? SoftDeletesValue { get; set; } + private SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Storage? StoreValue { get; set; } + private StorageDescriptor StoreDescriptor { get; set; } + private Action StoreDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeries? TimeSeriesValue { get; set; } + private IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } + private Action TimeSeriesDescriptorAction { get; set; } + private int? TopMetricsMaxSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Translog? TranslogValue { get; set; } + private TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } + private string? UuidValue { get; set; } + private Union? VerifiedBeforeCloseValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? VersionValue { get; set; } + private IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } + + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? index) + { + IndexDescriptor = null; + IndexDescriptorAction = null; + IndexValue = index; + return Self; + } + + public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + { + IndexValue = null; + IndexDescriptorAction = null; + IndexDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Index(Action configure) + { + IndexValue = null; + IndexDescriptor = null; + IndexDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortValue = sort; + return Self; + } + + public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Settings to define analyzers, tokenizers, token filters and character filters. + /// + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyze? analyze) + { + AnalyzeDescriptor = null; + AnalyzeDescriptorAction = null; + AnalyzeValue = analyze; + return Self; + } + + public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + { + AnalyzeValue = null; + AnalyzeDescriptorAction = null; + AnalyzeDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Analyze(Action configure) + { + AnalyzeValue = null; + AnalyzeDescriptor = null; + AnalyzeDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor AutoExpandReplicas(string? autoExpandReplicas) + { + AutoExpandReplicasValue = autoExpandReplicas; + return Self; + } + + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocks? blocks) + { + BlocksDescriptor = null; + BlocksDescriptorAction = null; + BlocksValue = blocks; + return Self; + } + + public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + { + BlocksValue = null; + BlocksDescriptorAction = null; + BlocksDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Blocks(Action configure) + { + BlocksValue = null; + BlocksDescriptor = null; + BlocksDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor CheckOnStartup(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexCheckOnStartup? checkOnStartup) + { + CheckOnStartupValue = checkOnStartup; + return Self; + } + + public IndexSettingsDescriptor Codec(string? codec) + { + CodecValue = codec; + return Self; + } + + public IndexSettingsDescriptor CreationDate(long? creationDate) + { + CreationDateValue = creationDate; + return Self; + } + + public IndexSettingsDescriptor CreationDateString(DateTimeOffset? creationDateString) + { + CreationDateStringValue = creationDateString; + return Self; + } + + public IndexSettingsDescriptor DefaultPipeline(string? defaultPipeline) + { + DefaultPipelineValue = defaultPipeline; + return Self; + } + + public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) + { + FinalPipelineValue = finalPipeline; + return Self; + } + + public IndexSettingsDescriptor Format(Union? format) + { + FormatValue = format; + return Self; + } + + public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearch.Serverless.Duration? gcDeletes) + { + GcDeletesValue = gcDeletes; + return Self; + } + + public IndexSettingsDescriptor Hidden(Union? hidden) + { + HiddenValue = hidden; + return Self; + } + + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? highlight) + { + HighlightDescriptor = null; + HighlightDescriptorAction = null; + HighlightValue = highlight; + return Self; + } + + public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + { + HighlightValue = null; + HighlightDescriptorAction = null; + HighlightDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Highlight(Action configure) + { + HighlightValue = null; + HighlightDescriptor = null; + HighlightDescriptorAction = configure; + return Self; + } + + /// + /// Configure indexing back pressure limits. + /// + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressure? indexingPressure) + { + IndexingPressureDescriptor = null; + IndexingPressureDescriptorAction = null; + IndexingPressureValue = indexingPressure; + return Self; + } + + public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + { + IndexingPressureValue = null; + IndexingPressureDescriptorAction = null; + IndexingPressureDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor IndexingPressure(Action configure) + { + IndexingPressureValue = null; + IndexingPressureDescriptor = null; + IndexingPressureDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettings? indexingSlowlog) + { + IndexingSlowlogDescriptor = null; + IndexingSlowlogDescriptorAction = null; + IndexingSlowlogValue = indexingSlowlog; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + { + IndexingSlowlogValue = null; + IndexingSlowlogDescriptorAction = null; + IndexingSlowlogDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor IndexingSlowlog(Action configure) + { + IndexingSlowlogValue = null; + IndexingSlowlogDescriptor = null; + IndexingSlowlogDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor LoadFixedBitsetFiltersEagerly(bool? loadFixedBitsetFiltersEagerly = true) + { + LoadFixedBitsetFiltersEagerlyValue = loadFixedBitsetFiltersEagerly; + return Self; + } + + /// + /// Enable or disable dynamic mapping for an index. + /// + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettings? mapping) + { + MappingDescriptor = null; + MappingDescriptorAction = null; + MappingValue = mapping; + return Self; + } + + public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + { + MappingValue = null; + MappingDescriptorAction = null; + MappingDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Mapping(Action configure) + { + MappingValue = null; + MappingDescriptor = null; + MappingDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor MaxDocvalueFieldsSearch(int? maxDocvalueFieldsSearch) + { + MaxDocvalueFieldsSearchValue = maxDocvalueFieldsSearch; + return Self; + } + + public IndexSettingsDescriptor MaxInnerResultWindow(int? maxInnerResultWindow) + { + MaxInnerResultWindowValue = maxInnerResultWindow; + return Self; + } + + public IndexSettingsDescriptor MaxNgramDiff(int? maxNgramDiff) + { + MaxNgramDiffValue = maxNgramDiff; + return Self; + } + + public IndexSettingsDescriptor MaxRefreshListeners(int? maxRefreshListeners) + { + MaxRefreshListenersValue = maxRefreshListeners; + return Self; + } + + public IndexSettingsDescriptor MaxRegexLength(int? maxRegexLength) + { + MaxRegexLengthValue = maxRegexLength; + return Self; + } + + public IndexSettingsDescriptor MaxRescoreWindow(int? maxRescoreWindow) + { + MaxRescoreWindowValue = maxRescoreWindow; + return Self; + } + + public IndexSettingsDescriptor MaxResultWindow(int? maxResultWindow) + { + MaxResultWindowValue = maxResultWindow; + return Self; + } + + public IndexSettingsDescriptor MaxScriptFields(int? maxScriptFields) + { + MaxScriptFieldsValue = maxScriptFields; + return Self; + } + + public IndexSettingsDescriptor MaxShingleDiff(int? maxShingleDiff) + { + MaxShingleDiffValue = maxShingleDiff; + return Self; + } + + public IndexSettingsDescriptor MaxSlicesPerScroll(int? maxSlicesPerScroll) + { + MaxSlicesPerScrollValue = maxSlicesPerScroll; + return Self; + } + + public IndexSettingsDescriptor MaxTermsCount(int? maxTermsCount) + { + MaxTermsCountValue = maxTermsCount; + return Self; + } + + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Merge? merge) + { + MergeDescriptor = null; + MergeDescriptorAction = null; + MergeValue = merge; + return Self; + } + + public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + { + MergeValue = null; + MergeDescriptorAction = null; + MergeDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Merge(Action configure) + { + MergeValue = null; + MergeDescriptor = null; + MergeDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Mode(string? mode) + { + ModeValue = mode; + return Self; + } + + public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + { + NumberOfReplicasValue = numberOfReplicas; + return Self; + } + + public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRoutingShards) + { + NumberOfRoutingShardsValue = numberOfRoutingShards; + return Self; + } + + public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + { + NumberOfShardsValue = numberOfShards; + return Self; + } + + public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) + { + OtherSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexSettingsDescriptor Priority(Union? priority) + { + PriorityValue = priority; + return Self; + } + + public IndexSettingsDescriptor ProvidedName(Elastic.Clients.Elasticsearch.Serverless.Name? providedName) + { + ProvidedNameValue = providedName; + return Self; + } + + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Queries? queries) + { + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesValue = queries; + return Self; + } + + public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + { + QueriesValue = null; + QueriesDescriptorAction = null; + QueriesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Queries(Action configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryString? queryString) + { + QueryStringDescriptor = null; + QueryStringDescriptorAction = null; + QueryStringValue = queryString; + return Self; + } + + public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + { + QueryStringValue = null; + QueryStringDescriptorAction = null; + QueryStringDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor QueryString(Action configure) + { + QueryStringValue = null; + QueryStringDescriptor = null; + QueryStringDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor RefreshInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? refreshInterval) + { + RefreshIntervalValue = refreshInterval; + return Self; + } + + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor RoutingPartitionSize(int? routingPartitionSize) + { + RoutingPartitionSizeValue = routingPartitionSize; + return Self; + } + + public IndexSettingsDescriptor RoutingPath(ICollection? routingPath) + { + RoutingPathValue = routingPath; + return Self; + } + + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearch? search) + { + SearchDescriptor = null; + SearchDescriptorAction = null; + SearchValue = search; + return Self; + } + + public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + { + SearchValue = null; + SearchDescriptorAction = null; + SearchDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Search(Action configure) + { + SearchValue = null; + SearchDescriptor = null; + SearchDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Shards(int? shards) + { + ShardsValue = shards; + return Self; + } + + /// + /// Configure custom similarity settings to customize how search results are scored. + /// + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? similarity) + { + SimilarityDescriptor = null; + SimilarityDescriptorAction = null; + SimilarityValue = similarity; + return Self; + } + + public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + { + SimilarityValue = null; + SimilarityDescriptorAction = null; + SimilarityDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Similarity(Action configure) + { + SimilarityValue = null; + SimilarityDescriptor = null; + SimilarityDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? softDeletes) + { + SoftDeletesDescriptor = null; + SoftDeletesDescriptorAction = null; + SoftDeletesValue = softDeletes; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + { + SoftDeletesValue = null; + SoftDeletesDescriptorAction = null; + SoftDeletesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor SoftDeletes(Action configure) + { + SoftDeletesValue = null; + SoftDeletesDescriptor = null; + SoftDeletesDescriptorAction = configure; + return Self; + } + + /// + /// The store module allows you to control how index data is stored and accessed on disk. + /// + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Storage? store) + { + StoreDescriptor = null; + StoreDescriptorAction = null; + StoreValue = store; + return Self; + } + + public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + { + StoreValue = null; + StoreDescriptorAction = null; + StoreDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Store(Action configure) + { + StoreValue = null; + StoreDescriptor = null; + StoreDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeries? timeSeries) + { + TimeSeriesDescriptor = null; + TimeSeriesDescriptorAction = null; + TimeSeriesValue = timeSeries; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + { + TimeSeriesValue = null; + TimeSeriesDescriptorAction = null; + TimeSeriesDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor TimeSeries(Action configure) + { + TimeSeriesValue = null; + TimeSeriesDescriptor = null; + TimeSeriesDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor TopMetricsMaxSize(int? topMetricsMaxSize) + { + TopMetricsMaxSizeValue = topMetricsMaxSize; + return Self; + } + + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Translog? translog) + { + TranslogDescriptor = null; + TranslogDescriptorAction = null; + TranslogValue = translog; + return Self; + } + + public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + { + TranslogValue = null; + TranslogDescriptorAction = null; + TranslogDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Translog(Action configure) + { + TranslogValue = null; + TranslogDescriptor = null; + TranslogDescriptorAction = configure; + return Self; + } + + public IndexSettingsDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + { + VerifiedBeforeCloseValue = verifiedBeforeClose; + return Self; + } + + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? version) + { + VersionDescriptor = null; + VersionDescriptorAction = null; + VersionValue = version; + return Self; + } + + public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + { + VersionValue = null; + VersionDescriptorAction = null; + VersionDescriptor = descriptor; + return Self; + } + + public IndexSettingsDescriptor Version(Action configure) + { + VersionValue = null; + VersionDescriptor = null; + VersionDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexDescriptor is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexDescriptor, options); + } + else if (IndexDescriptorAction is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + } + else if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (SortDescriptor is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortDescriptor, options); + } + else if (SortDescriptorAction is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (AnalysisDescriptor is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisDescriptor, options); + } + else if (AnalysisDescriptorAction is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzeDescriptor is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, AnalyzeDescriptor, options); + } + else if (AnalyzeDescriptorAction is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + } + else if (AnalyzeValue is not null) + { + writer.WritePropertyName("analyze"); + JsonSerializer.Serialize(writer, AnalyzeValue, options); + } + + if (!string.IsNullOrEmpty(AutoExpandReplicasValue)) + { + writer.WritePropertyName("auto_expand_replicas"); + writer.WriteStringValue(AutoExpandReplicasValue); + } + + if (BlocksDescriptor is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, BlocksDescriptor, options); + } + else if (BlocksDescriptorAction is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + } + else if (BlocksValue is not null) + { + writer.WritePropertyName("blocks"); + JsonSerializer.Serialize(writer, BlocksValue, options); + } + + if (CheckOnStartupValue is not null) + { + writer.WritePropertyName("check_on_startup"); + JsonSerializer.Serialize(writer, CheckOnStartupValue, options); + } + + if (!string.IsNullOrEmpty(CodecValue)) + { + writer.WritePropertyName("codec"); + writer.WriteStringValue(CodecValue); + } + + if (CreationDateValue is not null) + { + writer.WritePropertyName("creation_date"); + JsonSerializer.Serialize(writer, CreationDateValue, options); + } + + if (CreationDateStringValue is not null) + { + writer.WritePropertyName("creation_date_string"); + JsonSerializer.Serialize(writer, CreationDateStringValue, options); + } + + if (DefaultPipelineValue is not null) + { + writer.WritePropertyName("default_pipeline"); + JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + } + + if (FinalPipelineValue is not null) + { + writer.WritePropertyName("final_pipeline"); + JsonSerializer.Serialize(writer, FinalPipelineValue, options); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (GcDeletesValue is not null) + { + writer.WritePropertyName("gc_deletes"); + JsonSerializer.Serialize(writer, GcDeletesValue, options); + } + + if (HiddenValue is not null) + { + writer.WritePropertyName("hidden"); + JsonSerializer.Serialize(writer, HiddenValue, options); + } + + if (HighlightDescriptor is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightDescriptor, options); + } + else if (HighlightDescriptorAction is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + } + else if (HighlightValue is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, HighlightValue, options); + } + + if (IndexingPressureDescriptor is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, IndexingPressureDescriptor, options); + } + else if (IndexingPressureDescriptorAction is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + } + else if (IndexingPressureValue is not null) + { + writer.WritePropertyName("indexing_pressure"); + JsonSerializer.Serialize(writer, IndexingPressureValue, options); + } + + if (IndexingSlowlogDescriptor is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, IndexingSlowlogDescriptor, options); + } + else if (IndexingSlowlogDescriptorAction is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + } + else if (IndexingSlowlogValue is not null) + { + writer.WritePropertyName("indexing.slowlog"); + JsonSerializer.Serialize(writer, IndexingSlowlogValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + if (LoadFixedBitsetFiltersEagerlyValue.HasValue) + { + writer.WritePropertyName("load_fixed_bitset_filters_eagerly"); + writer.WriteBooleanValue(LoadFixedBitsetFiltersEagerlyValue.Value); + } + + if (MappingDescriptor is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, MappingDescriptor, options); + } + else if (MappingDescriptorAction is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + } + else if (MappingValue is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, MappingValue, options); + } + + if (MaxDocvalueFieldsSearchValue.HasValue) + { + writer.WritePropertyName("max_docvalue_fields_search"); + writer.WriteNumberValue(MaxDocvalueFieldsSearchValue.Value); + } + + if (MaxInnerResultWindowValue.HasValue) + { + writer.WritePropertyName("max_inner_result_window"); + writer.WriteNumberValue(MaxInnerResultWindowValue.Value); + } + + if (MaxNgramDiffValue.HasValue) + { + writer.WritePropertyName("max_ngram_diff"); + writer.WriteNumberValue(MaxNgramDiffValue.Value); + } + + if (MaxRefreshListenersValue.HasValue) + { + writer.WritePropertyName("max_refresh_listeners"); + writer.WriteNumberValue(MaxRefreshListenersValue.Value); + } + + if (MaxRegexLengthValue.HasValue) + { + writer.WritePropertyName("max_regex_length"); + writer.WriteNumberValue(MaxRegexLengthValue.Value); + } + + if (MaxRescoreWindowValue.HasValue) + { + writer.WritePropertyName("max_rescore_window"); + writer.WriteNumberValue(MaxRescoreWindowValue.Value); + } + + if (MaxResultWindowValue.HasValue) + { + writer.WritePropertyName("max_result_window"); + writer.WriteNumberValue(MaxResultWindowValue.Value); + } + + if (MaxScriptFieldsValue.HasValue) + { + writer.WritePropertyName("max_script_fields"); + writer.WriteNumberValue(MaxScriptFieldsValue.Value); + } + + if (MaxShingleDiffValue.HasValue) + { + writer.WritePropertyName("max_shingle_diff"); + writer.WriteNumberValue(MaxShingleDiffValue.Value); + } + + if (MaxSlicesPerScrollValue.HasValue) + { + writer.WritePropertyName("max_slices_per_scroll"); + writer.WriteNumberValue(MaxSlicesPerScrollValue.Value); + } + + if (MaxTermsCountValue.HasValue) + { + writer.WritePropertyName("max_terms_count"); + writer.WriteNumberValue(MaxTermsCountValue.Value); + } + + if (MergeDescriptor is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, MergeDescriptor, options); + } + else if (MergeDescriptorAction is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + } + else if (MergeValue is not null) + { + writer.WritePropertyName("merge"); + JsonSerializer.Serialize(writer, MergeValue, options); + } + + if (!string.IsNullOrEmpty(ModeValue)) + { + writer.WritePropertyName("mode"); + writer.WriteStringValue(ModeValue); + } + + if (NumberOfReplicasValue is not null) + { + writer.WritePropertyName("number_of_replicas"); + JsonSerializer.Serialize(writer, NumberOfReplicasValue, options); + } + + if (NumberOfRoutingShardsValue.HasValue) + { + writer.WritePropertyName("number_of_routing_shards"); + writer.WriteNumberValue(NumberOfRoutingShardsValue.Value); + } + + if (NumberOfShardsValue is not null) + { + writer.WritePropertyName("number_of_shards"); + JsonSerializer.Serialize(writer, NumberOfShardsValue, options); + } + + if (PriorityValue is not null) + { + writer.WritePropertyName("priority"); + JsonSerializer.Serialize(writer, PriorityValue, options); + } + + if (ProvidedNameValue is not null) + { + writer.WritePropertyName("provided_name"); + JsonSerializer.Serialize(writer, ProvidedNameValue, options); + } + + if (QueriesDescriptor is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesDescriptor, options); + } + else if (QueriesDescriptorAction is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + } + else if (QueriesValue is not null) + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesValue, options); + } + + if (QueryStringDescriptor is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, QueryStringDescriptor, options); + } + else if (QueryStringDescriptorAction is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + } + else if (QueryStringValue is not null) + { + writer.WritePropertyName("query_string"); + JsonSerializer.Serialize(writer, QueryStringValue, options); + } + + if (RefreshIntervalValue is not null) + { + writer.WritePropertyName("refresh_interval"); + JsonSerializer.Serialize(writer, RefreshIntervalValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (RoutingPartitionSizeValue is not null) + { + writer.WritePropertyName("routing_partition_size"); + JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + } + + if (RoutingPathValue is not null) + { + writer.WritePropertyName("routing_path"); + SingleOrManySerializationHelper.Serialize(RoutingPathValue, writer, options); + } + + if (SearchDescriptor is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, SearchDescriptor, options); + } + else if (SearchDescriptorAction is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + } + else if (SearchValue is not null) + { + writer.WritePropertyName("search"); + JsonSerializer.Serialize(writer, SearchValue, options); + } + + if (ShardsValue.HasValue) + { + writer.WritePropertyName("shards"); + writer.WriteNumberValue(ShardsValue.Value); + } + + if (SimilarityDescriptor is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, SimilarityDescriptor, options); + } + else if (SimilarityDescriptorAction is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, new SettingsSimilarityDescriptor(SimilarityDescriptorAction), options); + } + else if (SimilarityValue is not null) + { + writer.WritePropertyName("similarity"); + JsonSerializer.Serialize(writer, SimilarityValue, options); + } + + if (SoftDeletesDescriptor is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, SoftDeletesDescriptor, options); + } + else if (SoftDeletesDescriptorAction is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + } + else if (SoftDeletesValue is not null) + { + writer.WritePropertyName("soft_deletes"); + JsonSerializer.Serialize(writer, SoftDeletesValue, options); + } + + if (StoreDescriptor is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, StoreDescriptor, options); + } + else if (StoreDescriptorAction is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + } + else if (StoreValue is not null) + { + writer.WritePropertyName("store"); + JsonSerializer.Serialize(writer, StoreValue, options); + } + + if (TimeSeriesDescriptor is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, TimeSeriesDescriptor, options); + } + else if (TimeSeriesDescriptorAction is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + } + else if (TimeSeriesValue is not null) + { + writer.WritePropertyName("time_series"); + JsonSerializer.Serialize(writer, TimeSeriesValue, options); + } + + if (TopMetricsMaxSizeValue.HasValue) + { + writer.WritePropertyName("top_metrics_max_size"); + writer.WriteNumberValue(TopMetricsMaxSizeValue.Value); + } + + if (TranslogDescriptor is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, TranslogDescriptor, options); + } + else if (TranslogDescriptorAction is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + } + else if (TranslogValue is not null) + { + writer.WritePropertyName("translog"); + JsonSerializer.Serialize(writer, TranslogValue, options); + } + + if (UuidValue is not null) + { + writer.WritePropertyName("uuid"); + JsonSerializer.Serialize(writer, UuidValue, options); + } + + if (VerifiedBeforeCloseValue is not null) + { + writer.WritePropertyName("verified_before_close"); + JsonSerializer.Serialize(writer, VerifiedBeforeCloseValue, options); + } + + if (VersionDescriptor is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionDescriptor, options); + } + else if (VersionDescriptorAction is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + } + else if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (OtherSettingsValue != null) + { + foreach (var additionalProperty in OtherSettingsValue) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs new file mode 100644 index 00000000000..e6801cd9312 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSettingsAnalysis +{ + [JsonInclude, JsonPropertyName("analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? Analyzers { get; set; } + [JsonInclude, JsonPropertyName("char_filter")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.CharFilters? CharFilters { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFilters? TokenFilters { get; set; } + [JsonInclude, JsonPropertyName("normalizer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.Normalizers? Normalizers { get; set; } + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.Tokenizers? Tokenizers { get; set; } +} + +public sealed partial class IndexSettingsAnalysisDescriptor : SerializableDescriptor +{ + internal IndexSettingsAnalysisDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingsAnalysisDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? AnalyzersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.CharFilters? CharFiltersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFilters? TokenFiltersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Normalizers? NormalizersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.Tokenizers? TokenizersValue { get; set; } + + public IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? analyzers) + { + AnalyzersValue = analyzers; + return Self; + } + + public IndexSettingsAnalysisDescriptor Analyzers(Analysis.AnalyzersDescriptor descriptor) + { + AnalyzersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor Analyzers(Action configure) + { + var descriptor = new Analysis.AnalyzersDescriptor(); + configure?.Invoke(descriptor); + AnalyzersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch.Serverless.Analysis.CharFilters? charFilters) + { + CharFiltersValue = charFilters; + return Self; + } + + public IndexSettingsAnalysisDescriptor CharFilters(Analysis.CharFiltersDescriptor descriptor) + { + CharFiltersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor CharFilters(Action configure) + { + var descriptor = new Analysis.CharFiltersDescriptor(); + configure?.Invoke(descriptor); + CharFiltersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFilters? tokenFilters) + { + TokenFiltersValue = tokenFilters; + return Self; + } + + public IndexSettingsAnalysisDescriptor TokenFilters(Analysis.TokenFiltersDescriptor descriptor) + { + TokenFiltersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor TokenFilters(Action configure) + { + var descriptor = new Analysis.TokenFiltersDescriptor(); + configure?.Invoke(descriptor); + TokenFiltersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch.Serverless.Analysis.Normalizers? normalizers) + { + NormalizersValue = normalizers; + return Self; + } + + public IndexSettingsAnalysisDescriptor Normalizers(Analysis.NormalizersDescriptor descriptor) + { + NormalizersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor Normalizers(Action configure) + { + var descriptor = new Analysis.NormalizersDescriptor(); + configure?.Invoke(descriptor); + NormalizersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch.Serverless.Analysis.Tokenizers? tokenizers) + { + TokenizersValue = tokenizers; + return Self; + } + + public IndexSettingsAnalysisDescriptor Tokenizers(Analysis.TokenizersDescriptor descriptor) + { + TokenizersValue = descriptor.PromisedValue; + return Self; + } + + public IndexSettingsAnalysisDescriptor Tokenizers(Action configure) + { + var descriptor = new Analysis.TokenizersDescriptor(); + configure?.Invoke(descriptor); + TokenizersValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalyzersValue is not null) + { + writer.WritePropertyName("analyzer"); + JsonSerializer.Serialize(writer, AnalyzersValue, options); + } + + if (CharFiltersValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFiltersValue, options); + } + + if (TokenFiltersValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, TokenFiltersValue, options); + } + + if (NormalizersValue is not null) + { + writer.WritePropertyName("normalizer"); + JsonSerializer.Serialize(writer, NormalizersValue, options); + } + + if (TokenizersValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizersValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs new file mode 100644 index 00000000000..a215bc9c5a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSettingsLifecycle +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("indexing_complete")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool? IndexingComplete { get; set; } + + /// + /// The name of the policy to use to manage the index. For information about how Elasticsearch applies policy changes, see Policy updates. + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name Name { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("origination_date")] + public long? OriginationDate { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("parse_origination_date")] + public bool? ParseOriginationDate { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("rollover_alias")] + public string? RolloverAlias { get; set; } + [JsonInclude, JsonPropertyName("step")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleStep? Step { get; set; } +} + +public sealed partial class IndexSettingsLifecycleDescriptor : SerializableDescriptor +{ + internal IndexSettingsLifecycleDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingsLifecycleDescriptor() : base() + { + } + + private bool? IndexingCompleteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + private long? OriginationDateValue { get; set; } + private bool? ParseOriginationDateValue { get; set; } + private string? RolloverAliasValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleStep? StepValue { get; set; } + private IndexSettingsLifecycleStepDescriptor StepDescriptor { get; set; } + private Action StepDescriptorAction { get; set; } + + /// + /// 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.
+ ///
+ public IndexSettingsLifecycleDescriptor IndexingComplete(bool? indexingComplete = true) + { + IndexingCompleteValue = indexingComplete; + return Self; + } + + /// + /// The name of the policy to use to manage the index. For information about how Elasticsearch applies policy changes, see Policy updates. + /// + public IndexSettingsLifecycleDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + /// + /// 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.
+ ///
+ public IndexSettingsLifecycleDescriptor OriginationDate(long? originationDate) + { + OriginationDateValue = originationDate; + return Self; + } + + /// + /// 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.
+ ///
+ public IndexSettingsLifecycleDescriptor ParseOriginationDate(bool? parseOriginationDate = true) + { + ParseOriginationDateValue = parseOriginationDate; + return Self; + } + + /// + /// 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.
+ ///
+ public IndexSettingsLifecycleDescriptor RolloverAlias(string? rolloverAlias) + { + RolloverAliasValue = rolloverAlias; + return Self; + } + + public IndexSettingsLifecycleDescriptor Step(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleStep? step) + { + StepDescriptor = null; + StepDescriptorAction = null; + StepValue = step; + return Self; + } + + public IndexSettingsLifecycleDescriptor Step(IndexSettingsLifecycleStepDescriptor descriptor) + { + StepValue = null; + StepDescriptorAction = null; + StepDescriptor = descriptor; + return Self; + } + + public IndexSettingsLifecycleDescriptor Step(Action configure) + { + StepValue = null; + StepDescriptor = null; + StepDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexingCompleteValue is not null) + { + writer.WritePropertyName("indexing_complete"); + JsonSerializer.Serialize(writer, IndexingCompleteValue, options); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + if (OriginationDateValue.HasValue) + { + writer.WritePropertyName("origination_date"); + writer.WriteNumberValue(OriginationDateValue.Value); + } + + if (ParseOriginationDateValue.HasValue) + { + writer.WritePropertyName("parse_origination_date"); + writer.WriteBooleanValue(ParseOriginationDateValue.Value); + } + + if (!string.IsNullOrEmpty(RolloverAliasValue)) + { + writer.WritePropertyName("rollover_alias"); + writer.WriteStringValue(RolloverAliasValue); + } + + if (StepDescriptor is not null) + { + writer.WritePropertyName("step"); + JsonSerializer.Serialize(writer, StepDescriptor, options); + } + else if (StepDescriptorAction is not null) + { + writer.WritePropertyName("step"); + JsonSerializer.Serialize(writer, new IndexSettingsLifecycleStepDescriptor(StepDescriptorAction), options); + } + else if (StepValue is not null) + { + writer.WritePropertyName("step"); + JsonSerializer.Serialize(writer, StepValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs new file mode 100644 index 00000000000..93d2c1bbc57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSettingsLifecycleStep +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("wait_time_threshold")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitTimeThreshold { get; set; } +} + +public sealed partial class IndexSettingsLifecycleStepDescriptor : SerializableDescriptor +{ + internal IndexSettingsLifecycleStepDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingsLifecycleStepDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? WaitTimeThresholdValue { get; set; } + + /// + /// 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.
+ ///
+ public IndexSettingsLifecycleStepDescriptor WaitTimeThreshold(Elastic.Clients.Elasticsearch.Serverless.Duration? waitTimeThreshold) + { + WaitTimeThresholdValue = waitTimeThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (WaitTimeThresholdValue is not null) + { + writer.WritePropertyName("wait_time_threshold"); + JsonSerializer.Serialize(writer, WaitTimeThresholdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs new file mode 100644 index 00000000000..800232321e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexSettingsTimeSeries +{ + [JsonInclude, JsonPropertyName("end_time")] + public DateTimeOffset? EndTime { get; set; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; set; } +} + +public sealed partial class IndexSettingsTimeSeriesDescriptor : SerializableDescriptor +{ + internal IndexSettingsTimeSeriesDescriptor(Action configure) => configure.Invoke(this); + + public IndexSettingsTimeSeriesDescriptor() : base() + { + } + + private DateTimeOffset? EndTimeValue { get; set; } + private DateTimeOffset? StartTimeValue { get; set; } + + public IndexSettingsTimeSeriesDescriptor EndTime(DateTimeOffset? endTime) + { + EndTimeValue = endTime; + return Self; + } + + public IndexSettingsTimeSeriesDescriptor StartTime(DateTimeOffset? startTime) + { + StartTimeValue = startTime; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EndTimeValue is not null) + { + writer.WritePropertyName("end_time"); + JsonSerializer.Serialize(writer, EndTimeValue, options); + } + + if (StartTimeValue is not null) + { + writer.WritePropertyName("start_time"); + JsonSerializer.Serialize(writer, StartTimeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexState.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexState.g.cs new file mode 100644 index 00000000000..d4f3cb6564c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexState.g.cs @@ -0,0 +1,492 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexState +{ + [JsonInclude, JsonPropertyName("aliases")] + public IDictionary? Aliases { get; set; } + [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.Serverless.DataStreamName? DataStream { get; set; } + + /// + /// Default settings, included when the request's `include_default` is `true`. + /// + [JsonInclude, JsonPropertyName("defaults")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Defaults { get; set; } + + /// + /// Data lifecycle applicable if this is a data stream. + /// + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? Lifecycle { get; set; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } +} + +public sealed partial class IndexStateDescriptor : SerializableDescriptor> +{ + internal IndexStateDescriptor(Action> configure) => configure.Invoke(this); + + public IndexStateDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? DefaultsValue { get; set; } + private IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action> DefaultsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DataStreamName? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? LifecycleValue { get; set; } + private DataLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + + /// + /// Default settings, included when the request's `include_default` is `true`. + /// + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? defaults) + { + DefaultsDescriptor = null; + DefaultsDescriptorAction = null; + DefaultsValue = defaults; + return Self; + } + + public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + { + DefaultsValue = null; + DefaultsDescriptorAction = null; + DefaultsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Defaults(Action> configure) + { + DefaultsValue = null; + DefaultsDescriptor = null; + DefaultsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Mappings(Action> configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexStateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName? dataStream) + { + DataStreamValue = dataStream; + return Self; + } + + /// + /// Data lifecycle applicable if this is a data stream. + /// + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexStateDescriptor Lifecycle(DataLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DefaultsDescriptor is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, DefaultsDescriptor, options); + } + else if (DefaultsDescriptorAction is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + } + else if (DefaultsValue is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, DefaultsValue, options); + } + + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new DataLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexStateDescriptor : SerializableDescriptor +{ + internal IndexStateDescriptor(Action configure) => configure.Invoke(this); + + public IndexStateDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? DefaultsValue { get; set; } + private IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action DefaultsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DataStreamName? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? LifecycleValue { get; set; } + private DataLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + + /// + /// Default settings, included when the request's `include_default` is `true`. + /// + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? defaults) + { + DefaultsDescriptor = null; + DefaultsDescriptorAction = null; + DefaultsValue = defaults; + return Self; + } + + public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + { + DefaultsValue = null; + DefaultsDescriptorAction = null; + DefaultsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Defaults(Action configure) + { + DefaultsValue = null; + DefaultsDescriptor = null; + DefaultsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexStateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName? dataStream) + { + DataStreamValue = dataStream; + return Self; + } + + /// + /// Data lifecycle applicable if this is a data stream. + /// + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexStateDescriptor Lifecycle(DataLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexStateDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DefaultsDescriptor is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, DefaultsDescriptor, options); + } + else if (DefaultsDescriptorAction is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + } + else if (DefaultsValue is not null) + { + writer.WritePropertyName("defaults"); + JsonSerializer.Serialize(writer, DefaultsValue, options); + } + + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new DataLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexStats.g.cs new file mode 100644 index 00000000000..32b00985513 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexStats.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexStats +{ + [JsonInclude, JsonPropertyName("bulk")] + public Elastic.Clients.Elasticsearch.Serverless.BulkStats? Bulk { get; init; } + + /// + /// Contains statistics about completions across all shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("completion")] + public Elastic.Clients.Elasticsearch.Serverless.CompletionStats? Completion { get; init; } + + /// + /// Contains statistics about documents across all primary shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("docs")] + public Elastic.Clients.Elasticsearch.Serverless.DocStats? Docs { get; init; } + + /// + /// Contains statistics about the field data cache across all shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("fielddata")] + public Elastic.Clients.Elasticsearch.Serverless.FielddataStats? Fielddata { get; init; } + + /// + /// Contains statistics about flush operations for the node. + /// + [JsonInclude, JsonPropertyName("flush")] + public Elastic.Clients.Elasticsearch.Serverless.FlushStats? Flush { get; init; } + + /// + /// Contains statistics about get operations for the node. + /// + [JsonInclude, JsonPropertyName("get")] + public Elastic.Clients.Elasticsearch.Serverless.GetStats? Get { get; init; } + + /// + /// Contains statistics about indexing operations for the node. + /// + [JsonInclude, JsonPropertyName("indexing")] + public Elastic.Clients.Elasticsearch.Serverless.IndexingStats? Indexing { get; init; } + + /// + /// Contains statistics about indices operations for the node. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndicesStats? Indices { get; init; } + + /// + /// Contains statistics about merge operations for the node. + /// + [JsonInclude, JsonPropertyName("merges")] + public Elastic.Clients.Elasticsearch.Serverless.MergesStats? Merges { get; init; } + + /// + /// Contains statistics about the query cache across all shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("query_cache")] + public Elastic.Clients.Elasticsearch.Serverless.QueryCacheStats? QueryCache { get; init; } + + /// + /// Contains statistics about recovery operations for the node. + /// + [JsonInclude, JsonPropertyName("recovery")] + public Elastic.Clients.Elasticsearch.Serverless.RecoveryStats? Recovery { get; init; } + + /// + /// Contains statistics about refresh operations for the node. + /// + [JsonInclude, JsonPropertyName("refresh")] + public Elastic.Clients.Elasticsearch.Serverless.RefreshStats? Refresh { get; init; } + + /// + /// Contains statistics about the request cache across all shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("request_cache")] + public Elastic.Clients.Elasticsearch.Serverless.RequestCacheStats? RequestCache { get; init; } + + /// + /// Contains statistics about search operations for the node. + /// + [JsonInclude, JsonPropertyName("search")] + public Elastic.Clients.Elasticsearch.Serverless.SearchStats? Search { get; init; } + + /// + /// Contains statistics about segments across all shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("segments")] + public Elastic.Clients.Elasticsearch.Serverless.SegmentsStats? Segments { get; init; } + [JsonInclude, JsonPropertyName("shard_stats")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardsTotalStats? ShardStats { get; init; } + + /// + /// Contains statistics about the size of shards assigned to the node. + /// + [JsonInclude, JsonPropertyName("store")] + public Elastic.Clients.Elasticsearch.Serverless.StoreStats? Store { get; init; } + + /// + /// Contains statistics about transaction log operations for the node. + /// + [JsonInclude, JsonPropertyName("translog")] + public Elastic.Clients.Elasticsearch.Serverless.TranslogStats? Translog { get; init; } + + /// + /// Contains statistics about index warming operations for the node. + /// + [JsonInclude, JsonPropertyName("warmer")] + public Elastic.Clients.Elasticsearch.Serverless.WarmerStats? Warmer { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs new file mode 100644 index 00000000000..2f9ce971731 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs @@ -0,0 +1,75 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexTemplate +{ + /// + /// Optional user metadata about the index template. May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("allow_auto_create")] + public bool? AllowAutoCreate { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("composed_of")] + public IReadOnlyCollection ComposedOf { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? DataStream { get; init; } + + /// + /// Name of the index template. + /// + [JsonInclude, JsonPropertyName("index_patterns")] + public IReadOnlyCollection IndexPatterns { get; init; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("priority")] + public long? Priority { get; init; } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? Template { get; init; } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs new file mode 100644 index 00000000000..fc932e82b63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexTemplateDataStreamConfiguration +{ + /// + /// If true, the data stream supports custom routing. + /// + [JsonInclude, JsonPropertyName("allow_custom_routing")] + public bool? AllowCustomRouting { get; init; } + + /// + /// If true, the data stream is hidden. + /// + [JsonInclude, JsonPropertyName("hidden")] + public bool? Hidden { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs new file mode 100644 index 00000000000..670c890ec14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexTemplateItem +{ + [JsonInclude, JsonPropertyName("index_template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate IndexTemplate { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs new file mode 100644 index 00000000000..75f9ea365a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs @@ -0,0 +1,385 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexTemplateMapping +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("aliases")] + public IDictionary? Aliases { get; set; } + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? Lifecycle { get; set; } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } + + /// + /// Configuration options for the index. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } +} + +public sealed partial class IndexTemplateMappingDescriptor : SerializableDescriptor> +{ + internal IndexTemplateMappingDescriptor(Action> configure) => configure.Invoke(this); + + public IndexTemplateMappingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? LifecycleValue { get; set; } + private DataLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Mappings(Action> configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public IndexTemplateMappingDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(DataLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new DataLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexTemplateMappingDescriptor : SerializableDescriptor +{ + internal IndexTemplateMappingDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateMappingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private IDictionary? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? LifecycleValue { get; set; } + private DataLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public IndexTemplateMappingDescriptor Aliases(Func, FluentDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycle? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(DataLifecycleDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateMappingDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingsDescriptor is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsDescriptor, options); + } + else if (MappingsDescriptorAction is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + } + else if (MappingsValue is not null) + { + writer.WritePropertyName("mappings"); + JsonSerializer.Serialize(writer, MappingsValue, options); + } + + if (SettingsDescriptor is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsDescriptor, options); + } + else if (SettingsDescriptorAction is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + JsonSerializer.Serialize(writer, AliasesValue, options); + } + + if (LifecycleDescriptor is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleDescriptor, options); + } + else if (LifecycleDescriptorAction is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, new DataLifecycleDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs new file mode 100644 index 00000000000..51ce582bba1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexTemplateSummary +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("aliases")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Alias))] + public IReadOnlyDictionary? Aliases { get; init; } + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataLifecycleWithRollover? Lifecycle { get; init; } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; init; } + + /// + /// Configuration options for the index. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs new file mode 100644 index 00000000000..62974414db7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexVersioning +{ + [JsonInclude, JsonPropertyName("created")] + public string? Created { get; set; } + [JsonInclude, JsonPropertyName("created_string")] + public string? CreatedString { get; set; } +} + +public sealed partial class IndexVersioningDescriptor : SerializableDescriptor +{ + internal IndexVersioningDescriptor(Action configure) => configure.Invoke(this); + + public IndexVersioningDescriptor() : base() + { + } + + private string? CreatedValue { get; set; } + private string? CreatedStringValue { get; set; } + + public IndexVersioningDescriptor Created(string? created) + { + CreatedValue = created; + return Self; + } + + public IndexVersioningDescriptor CreatedString(string? createdString) + { + CreatedStringValue = createdString; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CreatedValue is not null) + { + writer.WritePropertyName("created"); + JsonSerializer.Serialize(writer, CreatedValue, options); + } + + if (!string.IsNullOrEmpty(CreatedStringValue)) + { + writer.WritePropertyName("created_string"); + writer.WriteStringValue(CreatedStringValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs new file mode 100644 index 00000000000..df87d0a896a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs @@ -0,0 +1,93 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexingPressure +{ + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemory Memory { get; set; } +} + +public sealed partial class IndexingPressureDescriptor : SerializableDescriptor +{ + internal IndexingPressureDescriptor(Action configure) => configure.Invoke(this); + + public IndexingPressureDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemory MemoryValue { get; set; } + private IndexingPressureMemoryDescriptor MemoryDescriptor { get; set; } + private Action MemoryDescriptorAction { get; set; } + + public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemory memory) + { + MemoryDescriptor = null; + MemoryDescriptorAction = null; + MemoryValue = memory; + return Self; + } + + public IndexingPressureDescriptor Memory(IndexingPressureMemoryDescriptor descriptor) + { + MemoryValue = null; + MemoryDescriptorAction = null; + MemoryDescriptor = descriptor; + return Self; + } + + public IndexingPressureDescriptor Memory(Action configure) + { + MemoryValue = null; + MemoryDescriptor = null; + MemoryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MemoryDescriptor is not null) + { + writer.WritePropertyName("memory"); + JsonSerializer.Serialize(writer, MemoryDescriptor, options); + } + else if (MemoryDescriptorAction is not null) + { + writer.WritePropertyName("memory"); + JsonSerializer.Serialize(writer, new IndexingPressureMemoryDescriptor(MemoryDescriptorAction), options); + } + else + { + writer.WritePropertyName("memory"); + JsonSerializer.Serialize(writer, MemoryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs new file mode 100644 index 00000000000..789aea81308 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexingPressureMemory +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class IndexingPressureMemoryDescriptor : SerializableDescriptor +{ + internal IndexingPressureMemoryDescriptor(Action configure) => configure.Invoke(this); + + public IndexingPressureMemoryDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// 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.
+ ///
+ public IndexingPressureMemoryDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs new file mode 100644 index 00000000000..e192e767013 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexingSlowlogSettings +{ + [JsonInclude, JsonPropertyName("level")] + public string? Level { get; set; } + [JsonInclude, JsonPropertyName("reformat")] + public bool? Reformat { get; set; } + [JsonInclude, JsonPropertyName("source")] + public int? Source { get; set; } + [JsonInclude, JsonPropertyName("threshold")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholds? Threshold { get; set; } +} + +public sealed partial class IndexingSlowlogSettingsDescriptor : SerializableDescriptor +{ + internal IndexingSlowlogSettingsDescriptor(Action configure) => configure.Invoke(this); + + public IndexingSlowlogSettingsDescriptor() : base() + { + } + + private string? LevelValue { get; set; } + private bool? ReformatValue { get; set; } + private int? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholds? ThresholdValue { get; set; } + private IndexingSlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } + + public IndexingSlowlogSettingsDescriptor Level(string? level) + { + LevelValue = level; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Reformat(bool? reformat = true) + { + ReformatValue = reformat; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Source(int? source) + { + SourceValue = source; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholds? threshold) + { + ThresholdDescriptor = null; + ThresholdDescriptorAction = null; + ThresholdValue = threshold; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescriptor descriptor) + { + ThresholdValue = null; + ThresholdDescriptorAction = null; + ThresholdDescriptor = descriptor; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(Action configure) + { + ThresholdValue = null; + ThresholdDescriptor = null; + ThresholdDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LevelValue)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(LevelValue); + } + + if (ReformatValue.HasValue) + { + writer.WritePropertyName("reformat"); + writer.WriteBooleanValue(ReformatValue.Value); + } + + if (SourceValue.HasValue) + { + writer.WritePropertyName("source"); + writer.WriteNumberValue(SourceValue.Value); + } + + if (ThresholdDescriptor is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdDescriptor, options); + } + else if (ThresholdDescriptorAction is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, new IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + } + else if (ThresholdValue is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs new file mode 100644 index 00000000000..b5dde769778 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndexingSlowlogTresholds +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? Index { get; set; } +} + +public sealed partial class IndexingSlowlogTresholdsDescriptor : SerializableDescriptor +{ + internal IndexingSlowlogTresholdsDescriptor(Action configure) => configure.Invoke(this); + + public IndexingSlowlogTresholdsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? IndexValue { get; set; } + private SlowlogTresholdLevelsDescriptor IndexDescriptor { get; set; } + private Action IndexDescriptorAction { get; set; } + + /// + /// 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.
+ ///
+ public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? index) + { + IndexDescriptor = null; + IndexDescriptorAction = null; + IndexValue = index; + return Self; + } + + public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor descriptor) + { + IndexValue = null; + IndexDescriptorAction = null; + IndexDescriptor = descriptor; + return Self; + } + + public IndexingSlowlogTresholdsDescriptor Index(Action configure) + { + IndexValue = null; + IndexDescriptor = null; + IndexDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexDescriptor is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexDescriptor, options); + } + else if (IndexDescriptorAction is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); + } + else if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesStats.g.cs new file mode 100644 index 00000000000..3ca893656a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesStats.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class IndicesStats +{ + [JsonInclude, JsonPropertyName("health")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus? Health { get; init; } + [JsonInclude, JsonPropertyName("primaries")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStats? Primaries { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary>? Shards { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexMetadataState? Status { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStats? Total { get; init; } + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs new file mode 100644 index 00000000000..c83388b51ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs @@ -0,0 +1,354 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +/// +/// Mapping Limit Settings +/// +public sealed partial class MappingLimitSettings +{ + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("depth")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDepth? Depth { get; set; } + [JsonInclude, JsonPropertyName("dimension_fields")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDimensionFields? DimensionFields { get; set; } + [JsonInclude, JsonPropertyName("field_name_length")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsFieldNameLength? FieldNameLength { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("nested_fields")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedFields? NestedFields { get; set; } + [JsonInclude, JsonPropertyName("nested_objects")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedObjects? NestedObjects { get; set; } + [JsonInclude, JsonPropertyName("total_fields")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFields? TotalFields { get; set; } +} + +/// +/// Mapping Limit Settings +/// +public sealed partial class MappingLimitSettingsDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsDescriptor() : base() + { + } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDepth? DepthValue { get; set; } + private MappingLimitSettingsDepthDescriptor DepthDescriptor { get; set; } + private Action DepthDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDimensionFields? DimensionFieldsValue { get; set; } + private MappingLimitSettingsDimensionFieldsDescriptor DimensionFieldsDescriptor { get; set; } + private Action DimensionFieldsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsFieldNameLength? FieldNameLengthValue { get; set; } + private MappingLimitSettingsFieldNameLengthDescriptor FieldNameLengthDescriptor { get; set; } + private Action FieldNameLengthDescriptorAction { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedFields? NestedFieldsValue { get; set; } + private MappingLimitSettingsNestedFieldsDescriptor NestedFieldsDescriptor { get; set; } + private Action NestedFieldsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedObjects? NestedObjectsValue { get; set; } + private MappingLimitSettingsNestedObjectsDescriptor NestedObjectsDescriptor { get; set; } + private Action NestedObjectsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFields? TotalFieldsValue { get; set; } + private MappingLimitSettingsTotalFieldsDescriptor TotalFieldsDescriptor { get; set; } + private Action TotalFieldsDescriptorAction { get; set; } + + public MappingLimitSettingsDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public MappingLimitSettingsDescriptor Depth(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDepth? depth) + { + DepthDescriptor = null; + DepthDescriptorAction = null; + DepthValue = depth; + return Self; + } + + public MappingLimitSettingsDescriptor Depth(MappingLimitSettingsDepthDescriptor descriptor) + { + DepthValue = null; + DepthDescriptorAction = null; + DepthDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor Depth(Action configure) + { + DepthValue = null; + DepthDescriptor = null; + DepthDescriptorAction = configure; + return Self; + } + + public MappingLimitSettingsDescriptor DimensionFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDimensionFields? dimensionFields) + { + DimensionFieldsDescriptor = null; + DimensionFieldsDescriptorAction = null; + DimensionFieldsValue = dimensionFields; + return Self; + } + + public MappingLimitSettingsDescriptor DimensionFields(MappingLimitSettingsDimensionFieldsDescriptor descriptor) + { + DimensionFieldsValue = null; + DimensionFieldsDescriptorAction = null; + DimensionFieldsDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor DimensionFields(Action configure) + { + DimensionFieldsValue = null; + DimensionFieldsDescriptor = null; + DimensionFieldsDescriptorAction = configure; + return Self; + } + + public MappingLimitSettingsDescriptor FieldNameLength(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsFieldNameLength? fieldNameLength) + { + FieldNameLengthDescriptor = null; + FieldNameLengthDescriptorAction = null; + FieldNameLengthValue = fieldNameLength; + return Self; + } + + public MappingLimitSettingsDescriptor FieldNameLength(MappingLimitSettingsFieldNameLengthDescriptor descriptor) + { + FieldNameLengthValue = null; + FieldNameLengthDescriptorAction = null; + FieldNameLengthDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor FieldNameLength(Action configure) + { + FieldNameLengthValue = null; + FieldNameLengthDescriptor = null; + FieldNameLengthDescriptorAction = configure; + return Self; + } + + public MappingLimitSettingsDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public MappingLimitSettingsDescriptor NestedFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedFields? nestedFields) + { + NestedFieldsDescriptor = null; + NestedFieldsDescriptorAction = null; + NestedFieldsValue = nestedFields; + return Self; + } + + public MappingLimitSettingsDescriptor NestedFields(MappingLimitSettingsNestedFieldsDescriptor descriptor) + { + NestedFieldsValue = null; + NestedFieldsDescriptorAction = null; + NestedFieldsDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor NestedFields(Action configure) + { + NestedFieldsValue = null; + NestedFieldsDescriptor = null; + NestedFieldsDescriptorAction = configure; + return Self; + } + + public MappingLimitSettingsDescriptor NestedObjects(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedObjects? nestedObjects) + { + NestedObjectsDescriptor = null; + NestedObjectsDescriptorAction = null; + NestedObjectsValue = nestedObjects; + return Self; + } + + public MappingLimitSettingsDescriptor NestedObjects(MappingLimitSettingsNestedObjectsDescriptor descriptor) + { + NestedObjectsValue = null; + NestedObjectsDescriptorAction = null; + NestedObjectsDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor NestedObjects(Action configure) + { + NestedObjectsValue = null; + NestedObjectsDescriptor = null; + NestedObjectsDescriptorAction = configure; + return Self; + } + + public MappingLimitSettingsDescriptor TotalFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFields? totalFields) + { + TotalFieldsDescriptor = null; + TotalFieldsDescriptorAction = null; + TotalFieldsValue = totalFields; + return Self; + } + + public MappingLimitSettingsDescriptor TotalFields(MappingLimitSettingsTotalFieldsDescriptor descriptor) + { + TotalFieldsValue = null; + TotalFieldsDescriptorAction = null; + TotalFieldsDescriptor = descriptor; + return Self; + } + + public MappingLimitSettingsDescriptor TotalFields(Action configure) + { + TotalFieldsValue = null; + TotalFieldsDescriptor = null; + TotalFieldsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (DepthDescriptor is not null) + { + writer.WritePropertyName("depth"); + JsonSerializer.Serialize(writer, DepthDescriptor, options); + } + else if (DepthDescriptorAction is not null) + { + writer.WritePropertyName("depth"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsDepthDescriptor(DepthDescriptorAction), options); + } + else if (DepthValue is not null) + { + writer.WritePropertyName("depth"); + JsonSerializer.Serialize(writer, DepthValue, options); + } + + if (DimensionFieldsDescriptor is not null) + { + writer.WritePropertyName("dimension_fields"); + JsonSerializer.Serialize(writer, DimensionFieldsDescriptor, options); + } + else if (DimensionFieldsDescriptorAction is not null) + { + writer.WritePropertyName("dimension_fields"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsDimensionFieldsDescriptor(DimensionFieldsDescriptorAction), options); + } + else if (DimensionFieldsValue is not null) + { + writer.WritePropertyName("dimension_fields"); + JsonSerializer.Serialize(writer, DimensionFieldsValue, options); + } + + if (FieldNameLengthDescriptor is not null) + { + writer.WritePropertyName("field_name_length"); + JsonSerializer.Serialize(writer, FieldNameLengthDescriptor, options); + } + else if (FieldNameLengthDescriptorAction is not null) + { + writer.WritePropertyName("field_name_length"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsFieldNameLengthDescriptor(FieldNameLengthDescriptorAction), options); + } + else if (FieldNameLengthValue is not null) + { + writer.WritePropertyName("field_name_length"); + JsonSerializer.Serialize(writer, FieldNameLengthValue, options); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (NestedFieldsDescriptor is not null) + { + writer.WritePropertyName("nested_fields"); + JsonSerializer.Serialize(writer, NestedFieldsDescriptor, options); + } + else if (NestedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("nested_fields"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedFieldsDescriptor(NestedFieldsDescriptorAction), options); + } + else if (NestedFieldsValue is not null) + { + writer.WritePropertyName("nested_fields"); + JsonSerializer.Serialize(writer, NestedFieldsValue, options); + } + + if (NestedObjectsDescriptor is not null) + { + writer.WritePropertyName("nested_objects"); + JsonSerializer.Serialize(writer, NestedObjectsDescriptor, options); + } + else if (NestedObjectsDescriptorAction is not null) + { + writer.WritePropertyName("nested_objects"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedObjectsDescriptor(NestedObjectsDescriptorAction), options); + } + else if (NestedObjectsValue is not null) + { + writer.WritePropertyName("nested_objects"); + JsonSerializer.Serialize(writer, NestedObjectsValue, options); + } + + if (TotalFieldsDescriptor is not null) + { + writer.WritePropertyName("total_fields"); + JsonSerializer.Serialize(writer, TotalFieldsDescriptor, options); + } + else if (TotalFieldsDescriptorAction is not null) + { + writer.WritePropertyName("total_fields"); + JsonSerializer.Serialize(writer, new MappingLimitSettingsTotalFieldsDescriptor(TotalFieldsDescriptorAction), options); + } + else if (TotalFieldsValue is not null) + { + writer.WritePropertyName("total_fields"); + JsonSerializer.Serialize(writer, TotalFieldsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs new file mode 100644 index 00000000000..a9f38f6f97d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsDepth +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsDepthDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsDepthDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsDepthDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// 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.
+ ///
+ public MappingLimitSettingsDepthDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs new file mode 100644 index 00000000000..893a7f51121 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsDimensionFields +{ + /// + /// [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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsDimensionFieldsDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsDimensionFieldsDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsDimensionFieldsDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// [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.
+ ///
+ public MappingLimitSettingsDimensionFieldsDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs new file mode 100644 index 00000000000..1f8fab428c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsFieldNameLength +{ + /// + /// 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).
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public long? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsFieldNameLengthDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsFieldNameLengthDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsFieldNameLengthDescriptor() : base() + { + } + + private long? LimitValue { get; set; } + + /// + /// 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).
+ ///
+ public MappingLimitSettingsFieldNameLengthDescriptor Limit(long? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs new file mode 100644 index 00000000000..d3b9bbcaee6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsNestedFields +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsNestedFieldsDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsNestedFieldsDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsNestedFieldsDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// 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.
+ ///
+ public MappingLimitSettingsNestedFieldsDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs new file mode 100644 index 00000000000..7c7a7dbb189 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsNestedObjects +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsNestedObjectsDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsNestedObjectsDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsNestedObjectsDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// 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.
+ ///
+ public MappingLimitSettingsNestedObjectsDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs new file mode 100644 index 00000000000..d3f2e615e3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingLimitSettingsTotalFields +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public int? Limit { get; set; } +} + +public sealed partial class MappingLimitSettingsTotalFieldsDescriptor : SerializableDescriptor +{ + internal MappingLimitSettingsTotalFieldsDescriptor(Action configure) => configure.Invoke(this); + + public MappingLimitSettingsTotalFieldsDescriptor() : base() + { + } + + private int? LimitValue { get; set; } + + /// + /// 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.
+ ///
+ public MappingLimitSettingsTotalFieldsDescriptor Limit(int? limit) + { + LimitValue = limit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LimitValue.HasValue) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(LimitValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingStats.g.cs new file mode 100644 index 00000000000..c7e5c6f45ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingStats.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MappingStats +{ + [JsonInclude, JsonPropertyName("total_count")] + public long TotalCount { get; init; } + [JsonInclude, JsonPropertyName("total_estimated_overhead")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalEstimatedOverhead { get; init; } + [JsonInclude, JsonPropertyName("total_estimated_overhead_in_bytes")] + public long TotalEstimatedOverheadInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs new file mode 100644 index 00000000000..4ef0e6e23fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs @@ -0,0 +1,93 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Merge +{ + [JsonInclude, JsonPropertyName("scheduler")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeScheduler? Scheduler { get; set; } +} + +public sealed partial class MergeDescriptor : SerializableDescriptor +{ + internal MergeDescriptor(Action configure) => configure.Invoke(this); + + public MergeDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeScheduler? SchedulerValue { get; set; } + private MergeSchedulerDescriptor SchedulerDescriptor { get; set; } + private Action SchedulerDescriptorAction { get; set; } + + public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeScheduler? scheduler) + { + SchedulerDescriptor = null; + SchedulerDescriptorAction = null; + SchedulerValue = scheduler; + return Self; + } + + public MergeDescriptor Scheduler(MergeSchedulerDescriptor descriptor) + { + SchedulerValue = null; + SchedulerDescriptorAction = null; + SchedulerDescriptor = descriptor; + return Self; + } + + public MergeDescriptor Scheduler(Action configure) + { + SchedulerValue = null; + SchedulerDescriptor = null; + SchedulerDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SchedulerDescriptor is not null) + { + writer.WritePropertyName("scheduler"); + JsonSerializer.Serialize(writer, SchedulerDescriptor, options); + } + else if (SchedulerDescriptorAction is not null) + { + writer.WritePropertyName("scheduler"); + JsonSerializer.Serialize(writer, new MergeSchedulerDescriptor(SchedulerDescriptorAction), options); + } + else if (SchedulerValue is not null) + { + writer.WritePropertyName("scheduler"); + JsonSerializer.Serialize(writer, SchedulerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs new file mode 100644 index 00000000000..f4b6f414245 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class MergeScheduler +{ + [JsonInclude, JsonPropertyName("max_merge_count")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int? MaxMergeCount { get; set; } + [JsonInclude, JsonPropertyName("max_thread_count")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int? MaxThreadCount { get; set; } +} + +public sealed partial class MergeSchedulerDescriptor : SerializableDescriptor +{ + internal MergeSchedulerDescriptor(Action configure) => configure.Invoke(this); + + public MergeSchedulerDescriptor() : base() + { + } + + private int? MaxMergeCountValue { get; set; } + private int? MaxThreadCountValue { get; set; } + + public MergeSchedulerDescriptor MaxMergeCount(int? maxMergeCount) + { + MaxMergeCountValue = maxMergeCount; + return Self; + } + + public MergeSchedulerDescriptor MaxThreadCount(int? maxThreadCount) + { + MaxThreadCountValue = maxThreadCount; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxMergeCountValue is not null) + { + writer.WritePropertyName("max_merge_count"); + JsonSerializer.Serialize(writer, MaxMergeCountValue, options); + } + + if (MaxThreadCountValue is not null) + { + writer.WritePropertyName("max_thread_count"); + JsonSerializer.Serialize(writer, MaxThreadCountValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs new file mode 100644 index 00000000000..9b709e60f73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class NumericFielddata +{ + [JsonInclude, JsonPropertyName("format")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataFormat Format { get; set; } +} + +public sealed partial class NumericFielddataDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NumericFielddataDescriptor(Action configure) => configure.Invoke(this); + + public NumericFielddataDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataFormat FormatValue { get; set; } + + public NumericFielddataDescriptor Format(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataFormat format) + { + FormatValue = format; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + writer.WriteEndObject(); + } + + NumericFielddata IBuildableDescriptor.Build() => new() + { + Format = FormatValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Overlapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Overlapping.g.cs new file mode 100644 index 00000000000..497b86d024f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Overlapping.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Overlapping +{ + [JsonInclude, JsonPropertyName("index_patterns")] + public IReadOnlyCollection IndexPatterns { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs new file mode 100644 index 00000000000..68bce02a645 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs @@ -0,0 +1,93 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Queries +{ + [JsonInclude, JsonPropertyName("cache")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueries? Cache { get; set; } +} + +public sealed partial class QueriesDescriptor : SerializableDescriptor +{ + internal QueriesDescriptor(Action configure) => configure.Invoke(this); + + public QueriesDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueries? CacheValue { get; set; } + private CacheQueriesDescriptor CacheDescriptor { get; set; } + private Action CacheDescriptorAction { get; set; } + + public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueries? cache) + { + CacheDescriptor = null; + CacheDescriptorAction = null; + CacheValue = cache; + return Self; + } + + public QueriesDescriptor Cache(CacheQueriesDescriptor descriptor) + { + CacheValue = null; + CacheDescriptorAction = null; + CacheDescriptor = descriptor; + return Self; + } + + public QueriesDescriptor Cache(Action configure) + { + CacheValue = null; + CacheDescriptor = null; + CacheDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CacheDescriptor is not null) + { + writer.WritePropertyName("cache"); + JsonSerializer.Serialize(writer, CacheDescriptor, options); + } + else if (CacheDescriptorAction is not null) + { + writer.WritePropertyName("cache"); + JsonSerializer.Serialize(writer, new CacheQueriesDescriptor(CacheDescriptorAction), options); + } + else if (CacheValue is not null) + { + writer.WritePropertyName("cache"); + JsonSerializer.Serialize(writer, CacheValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs new file mode 100644 index 00000000000..70a3a3f3bac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs @@ -0,0 +1,159 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class RemoveAction +{ + /// + /// Alias for the action.
Index alias names support date math.
+ ///
+ [JsonInclude, JsonPropertyName("alias")] + public Elastic.Clients.Elasticsearch.Serverless.IndexAlias? Alias { get; set; } + + /// + /// Aliases for the action.
Index alias names support date math.
+ ///
+ [JsonInclude, JsonPropertyName("aliases"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexAlias))] + public ICollection? Aliases { get; set; } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// If `true`, the alias must exist to perform the action. + /// + [JsonInclude, JsonPropertyName("must_exist")] + public bool? MustExist { get; set; } + + public static implicit operator Action(RemoveAction removeAction) => IndexManagement.Action.Remove(removeAction); +} + +public sealed partial class RemoveActionDescriptor : SerializableDescriptor +{ + internal RemoveActionDescriptor(Action configure) => configure.Invoke(this); + + public RemoveActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexAlias? AliasValue { get; set; } + private ICollection? AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? MustExistValue { get; set; } + + /// + /// Alias for the action.
Index alias names support date math.
+ ///
+ public RemoveActionDescriptor Alias(Elastic.Clients.Elasticsearch.Serverless.IndexAlias? alias) + { + AliasValue = alias; + return Self; + } + + /// + /// Aliases for the action.
Index alias names support date math.
+ ///
+ public RemoveActionDescriptor Aliases(ICollection? aliases) + { + AliasesValue = aliases; + return Self; + } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ public RemoveActionDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ public RemoveActionDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// If `true`, the alias must exist to perform the action. + /// + public RemoveActionDescriptor MustExist(bool? mustExist = true) + { + MustExistValue = mustExist; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AliasValue is not null) + { + writer.WritePropertyName("alias"); + JsonSerializer.Serialize(writer, AliasValue, options); + } + + if (AliasesValue is not null) + { + writer.WritePropertyName("aliases"); + SingleOrManySerializationHelper.Serialize(AliasesValue, writer, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MustExistValue.HasValue) + { + writer.WritePropertyName("must_exist"); + writer.WriteBooleanValue(MustExistValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs new file mode 100644 index 00000000000..b8858db2732 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs @@ -0,0 +1,115 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class RemoveIndexAction +{ + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// If `true`, the alias must exist to perform the action. + /// + [JsonInclude, JsonPropertyName("must_exist")] + public bool? MustExist { get; set; } + + public static implicit operator Action(RemoveIndexAction removeIndexAction) => IndexManagement.Action.RemoveIndex(removeIndexAction); +} + +public sealed partial class RemoveIndexActionDescriptor : SerializableDescriptor +{ + internal RemoveIndexActionDescriptor(Action configure) => configure.Invoke(this); + + public RemoveIndexActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? MustExistValue { get; set; } + + /// + /// Data stream or index for the action.
Supports wildcards (`*`).
+ ///
+ public RemoveIndexActionDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// Data streams or indices for the action.
Supports wildcards (`*`).
+ ///
+ public RemoveIndexActionDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// If `true`, the alias must exist to perform the action. + /// + public RemoveIndexActionDescriptor MustExist(bool? mustExist = true) + { + MustExistValue = mustExist; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MustExistValue.HasValue) + { + writer.WritePropertyName("must_exist"); + writer.WriteBooleanValue(MustExistValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RetentionLease.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RetentionLease.g.cs new file mode 100644 index 00000000000..ca638b06cc7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RetentionLease.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class RetentionLease +{ + [JsonInclude, JsonPropertyName("period")] + public Elastic.Clients.Elasticsearch.Serverless.Duration Period { get; set; } +} + +public sealed partial class RetentionLeaseDescriptor : SerializableDescriptor +{ + internal RetentionLeaseDescriptor(Action configure) => configure.Invoke(this); + + public RetentionLeaseDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration PeriodValue { get; set; } + + public RetentionLeaseDescriptor Period(Elastic.Clients.Elasticsearch.Serverless.Duration period) + { + PeriodValue = period; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("period"); + JsonSerializer.Serialize(writer, PeriodValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs new file mode 100644 index 00000000000..51707573fa5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -0,0 +1,273 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class RolloverConditions +{ + [JsonInclude, JsonPropertyName("max_age")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MaxAge { get; set; } + [JsonInclude, JsonPropertyName("max_age_millis")] + public long? MaxAgeMillis { get; set; } + [JsonInclude, JsonPropertyName("max_docs")] + public long? MaxDocs { get; set; } + [JsonInclude, JsonPropertyName("max_primary_shard_docs")] + public long? MaxPrimaryShardDocs { get; set; } + [JsonInclude, JsonPropertyName("max_primary_shard_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSize { get; set; } + [JsonInclude, JsonPropertyName("max_primary_shard_size_bytes")] + public long? MaxPrimaryShardSizeBytes { get; set; } + [JsonInclude, JsonPropertyName("max_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSize { get; set; } + [JsonInclude, JsonPropertyName("max_size_bytes")] + public long? MaxSizeBytes { get; set; } + [JsonInclude, JsonPropertyName("min_age")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MinAge { get; set; } + [JsonInclude, JsonPropertyName("min_docs")] + public long? MinDocs { get; set; } + [JsonInclude, JsonPropertyName("min_primary_shard_docs")] + public long? MinPrimaryShardDocs { get; set; } + [JsonInclude, JsonPropertyName("min_primary_shard_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinPrimaryShardSize { get; set; } + [JsonInclude, JsonPropertyName("min_primary_shard_size_bytes")] + public long? MinPrimaryShardSizeBytes { get; set; } + [JsonInclude, JsonPropertyName("min_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSize { get; set; } + [JsonInclude, JsonPropertyName("min_size_bytes")] + public long? MinSizeBytes { get; set; } +} + +public sealed partial class RolloverConditionsDescriptor : SerializableDescriptor +{ + internal RolloverConditionsDescriptor(Action configure) => configure.Invoke(this); + + public RolloverConditionsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? MaxAgeValue { get; set; } + private long? MaxAgeMillisValue { get; set; } + private long? MaxDocsValue { get; set; } + private long? MaxPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSizeValue { get; set; } + private long? MaxPrimaryShardSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSizeValue { get; set; } + private long? MaxSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? MinAgeValue { get; set; } + private long? MinDocsValue { get; set; } + private long? MinPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinPrimaryShardSizeValue { get; set; } + private long? MinPrimaryShardSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSizeValue { get; set; } + private long? MinSizeBytesValue { get; set; } + + public RolloverConditionsDescriptor MaxAge(Elastic.Clients.Elasticsearch.Serverless.Duration? maxAge) + { + MaxAgeValue = maxAge; + return Self; + } + + public RolloverConditionsDescriptor MaxAgeMillis(long? maxAgeMillis) + { + MaxAgeMillisValue = maxAgeMillis; + return Self; + } + + public RolloverConditionsDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + public RolloverConditionsDescriptor MaxPrimaryShardDocs(long? maxPrimaryShardDocs) + { + MaxPrimaryShardDocsValue = maxPrimaryShardDocs; + return Self; + } + + public RolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxPrimaryShardSize) + { + MaxPrimaryShardSizeValue = maxPrimaryShardSize; + return Self; + } + + public RolloverConditionsDescriptor MaxPrimaryShardSizeBytes(long? maxPrimaryShardSizeBytes) + { + MaxPrimaryShardSizeBytesValue = maxPrimaryShardSizeBytes; + return Self; + } + + public RolloverConditionsDescriptor MaxSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSize) + { + MaxSizeValue = maxSize; + return Self; + } + + public RolloverConditionsDescriptor MaxSizeBytes(long? maxSizeBytes) + { + MaxSizeBytesValue = maxSizeBytes; + return Self; + } + + public RolloverConditionsDescriptor MinAge(Elastic.Clients.Elasticsearch.Serverless.Duration? minAge) + { + MinAgeValue = minAge; + return Self; + } + + public RolloverConditionsDescriptor MinDocs(long? minDocs) + { + MinDocsValue = minDocs; + return Self; + } + + public RolloverConditionsDescriptor MinPrimaryShardDocs(long? minPrimaryShardDocs) + { + MinPrimaryShardDocsValue = minPrimaryShardDocs; + return Self; + } + + public RolloverConditionsDescriptor MinPrimaryShardSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? minPrimaryShardSize) + { + MinPrimaryShardSizeValue = minPrimaryShardSize; + return Self; + } + + public RolloverConditionsDescriptor MinPrimaryShardSizeBytes(long? minPrimaryShardSizeBytes) + { + MinPrimaryShardSizeBytesValue = minPrimaryShardSizeBytes; + return Self; + } + + public RolloverConditionsDescriptor MinSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? minSize) + { + MinSizeValue = minSize; + return Self; + } + + public RolloverConditionsDescriptor MinSizeBytes(long? minSizeBytes) + { + MinSizeBytesValue = minSizeBytes; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxAgeValue is not null) + { + writer.WritePropertyName("max_age"); + JsonSerializer.Serialize(writer, MaxAgeValue, options); + } + + if (MaxAgeMillisValue is not null) + { + writer.WritePropertyName("max_age_millis"); + JsonSerializer.Serialize(writer, MaxAgeMillisValue, options); + } + + if (MaxDocsValue.HasValue) + { + writer.WritePropertyName("max_docs"); + writer.WriteNumberValue(MaxDocsValue.Value); + } + + if (MaxPrimaryShardDocsValue.HasValue) + { + writer.WritePropertyName("max_primary_shard_docs"); + writer.WriteNumberValue(MaxPrimaryShardDocsValue.Value); + } + + if (MaxPrimaryShardSizeValue is not null) + { + writer.WritePropertyName("max_primary_shard_size"); + JsonSerializer.Serialize(writer, MaxPrimaryShardSizeValue, options); + } + + if (MaxPrimaryShardSizeBytesValue.HasValue) + { + writer.WritePropertyName("max_primary_shard_size_bytes"); + writer.WriteNumberValue(MaxPrimaryShardSizeBytesValue.Value); + } + + if (MaxSizeValue is not null) + { + writer.WritePropertyName("max_size"); + JsonSerializer.Serialize(writer, MaxSizeValue, options); + } + + if (MaxSizeBytesValue.HasValue) + { + writer.WritePropertyName("max_size_bytes"); + writer.WriteNumberValue(MaxSizeBytesValue.Value); + } + + if (MinAgeValue is not null) + { + writer.WritePropertyName("min_age"); + JsonSerializer.Serialize(writer, MinAgeValue, options); + } + + if (MinDocsValue.HasValue) + { + writer.WritePropertyName("min_docs"); + writer.WriteNumberValue(MinDocsValue.Value); + } + + if (MinPrimaryShardDocsValue.HasValue) + { + writer.WritePropertyName("min_primary_shard_docs"); + writer.WriteNumberValue(MinPrimaryShardDocsValue.Value); + } + + if (MinPrimaryShardSizeValue is not null) + { + writer.WritePropertyName("min_primary_shard_size"); + JsonSerializer.Serialize(writer, MinPrimaryShardSizeValue, options); + } + + if (MinPrimaryShardSizeBytesValue.HasValue) + { + writer.WritePropertyName("min_primary_shard_size_bytes"); + writer.WriteNumberValue(MinPrimaryShardSizeBytesValue.Value); + } + + if (MinSizeValue is not null) + { + writer.WritePropertyName("min_size"); + JsonSerializer.Serialize(writer, MinSizeValue, options); + } + + if (MinSizeBytesValue.HasValue) + { + writer.WritePropertyName("min_size_bytes"); + writer.WriteNumberValue(MinSizeBytesValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SearchIdle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SearchIdle.g.cs new file mode 100644 index 00000000000..aa44abd1845 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SearchIdle.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SearchIdle +{ + [JsonInclude, JsonPropertyName("after")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? After { get; set; } +} + +public sealed partial class SearchIdleDescriptor : SerializableDescriptor +{ + internal SearchIdleDescriptor(Action configure) => configure.Invoke(this); + + public SearchIdleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? AfterValue { get; set; } + + public SearchIdleDescriptor After(Elastic.Clients.Elasticsearch.Serverless.Duration? after) + { + AfterValue = after; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AfterValue is not null) + { + writer.WritePropertyName("after"); + JsonSerializer.Serialize(writer, AfterValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs new file mode 100644 index 00000000000..f797c470310 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsAnalyze +{ + [JsonInclude, JsonPropertyName("max_token_count")] + [JsonConverter(typeof(StringifiedIntegerConverter))] + public int? MaxTokenCount { get; set; } +} + +public sealed partial class SettingsAnalyzeDescriptor : SerializableDescriptor +{ + internal SettingsAnalyzeDescriptor(Action configure) => configure.Invoke(this); + + public SettingsAnalyzeDescriptor() : base() + { + } + + private int? MaxTokenCountValue { get; set; } + + public SettingsAnalyzeDescriptor MaxTokenCount(int? maxTokenCount) + { + MaxTokenCountValue = maxTokenCount; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxTokenCountValue is not null) + { + writer.WritePropertyName("max_token_count"); + JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsHighlight.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsHighlight.g.cs new file mode 100644 index 00000000000..2f78a48feb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsHighlight.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsHighlight +{ + [JsonInclude, JsonPropertyName("max_analyzed_offset")] + public int? MaxAnalyzedOffset { get; set; } +} + +public sealed partial class SettingsHighlightDescriptor : SerializableDescriptor +{ + internal SettingsHighlightDescriptor(Action configure) => configure.Invoke(this); + + public SettingsHighlightDescriptor() : base() + { + } + + private int? MaxAnalyzedOffsetValue { get; set; } + + public SettingsHighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) + { + MaxAnalyzedOffsetValue = maxAnalyzedOffset; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxAnalyzedOffsetValue.HasValue) + { + writer.WritePropertyName("max_analyzed_offset"); + writer.WriteNumberValue(MaxAnalyzedOffsetValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs new file mode 100644 index 00000000000..66c977704ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs @@ -0,0 +1,60 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsQueryString +{ + [JsonInclude, JsonPropertyName("lenient")] + [JsonConverter(typeof(StringifiedBoolConverter))] + public bool Lenient { get; set; } +} + +public sealed partial class SettingsQueryStringDescriptor : SerializableDescriptor +{ + internal SettingsQueryStringDescriptor(Action configure) => configure.Invoke(this); + + public SettingsQueryStringDescriptor() : base() + { + } + + private bool LenientValue { get; set; } + + public SettingsQueryStringDescriptor Lenient(bool lenient = true) + { + LenientValue = lenient; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("lenient"); + JsonSerializer.Serialize(writer, LenientValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs new file mode 100644 index 00000000000..daa013eb089 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSearch +{ + [JsonInclude, JsonPropertyName("idle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdle? Idle { get; set; } + [JsonInclude, JsonPropertyName("slowlog")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettings? Slowlog { get; set; } +} + +public sealed partial class SettingsSearchDescriptor : SerializableDescriptor +{ + internal SettingsSearchDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSearchDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdle? IdleValue { get; set; } + private SearchIdleDescriptor IdleDescriptor { get; set; } + private Action IdleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettings? SlowlogValue { get; set; } + private SlowlogSettingsDescriptor SlowlogDescriptor { get; set; } + private Action SlowlogDescriptorAction { get; set; } + + public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdle? idle) + { + IdleDescriptor = null; + IdleDescriptorAction = null; + IdleValue = idle; + return Self; + } + + public SettingsSearchDescriptor Idle(SearchIdleDescriptor descriptor) + { + IdleValue = null; + IdleDescriptorAction = null; + IdleDescriptor = descriptor; + return Self; + } + + public SettingsSearchDescriptor Idle(Action configure) + { + IdleValue = null; + IdleDescriptor = null; + IdleDescriptorAction = configure; + return Self; + } + + public SettingsSearchDescriptor Slowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettings? slowlog) + { + SlowlogDescriptor = null; + SlowlogDescriptorAction = null; + SlowlogValue = slowlog; + return Self; + } + + public SettingsSearchDescriptor Slowlog(SlowlogSettingsDescriptor descriptor) + { + SlowlogValue = null; + SlowlogDescriptorAction = null; + SlowlogDescriptor = descriptor; + return Self; + } + + public SettingsSearchDescriptor Slowlog(Action configure) + { + SlowlogValue = null; + SlowlogDescriptor = null; + SlowlogDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdleDescriptor is not null) + { + writer.WritePropertyName("idle"); + JsonSerializer.Serialize(writer, IdleDescriptor, options); + } + else if (IdleDescriptorAction is not null) + { + writer.WritePropertyName("idle"); + JsonSerializer.Serialize(writer, new SearchIdleDescriptor(IdleDescriptorAction), options); + } + else if (IdleValue is not null) + { + writer.WritePropertyName("idle"); + JsonSerializer.Serialize(writer, IdleValue, options); + } + + if (SlowlogDescriptor is not null) + { + writer.WritePropertyName("slowlog"); + JsonSerializer.Serialize(writer, SlowlogDescriptor, options); + } + else if (SlowlogDescriptorAction is not null) + { + writer.WritePropertyName("slowlog"); + JsonSerializer.Serialize(writer, new SlowlogSettingsDescriptor(SlowlogDescriptorAction), options); + } + else if (SlowlogValue is not null) + { + writer.WritePropertyName("slowlog"); + JsonSerializer.Serialize(writer, SlowlogValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs new file mode 100644 index 00000000000..ab02a84f5a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs @@ -0,0 +1,363 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarity +{ + [JsonInclude, JsonPropertyName("bm25")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityBm25? Bm25 { get; set; } + [JsonInclude, JsonPropertyName("dfi")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfi? Dfi { get; set; } + [JsonInclude, JsonPropertyName("dfr")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfr? Dfr { get; set; } + [JsonInclude, JsonPropertyName("ib")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityIb? Ib { get; set; } + [JsonInclude, JsonPropertyName("lmd")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmd? Lmd { get; set; } + [JsonInclude, JsonPropertyName("lmj")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmj? Lmj { get; set; } + [JsonInclude, JsonPropertyName("scripted_tfidf")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityScriptedTfidf? ScriptedTfidf { get; set; } +} + +public sealed partial class SettingsSimilarityDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityBm25? Bm25Value { get; set; } + private SettingsSimilarityBm25Descriptor Bm25Descriptor { get; set; } + private Action Bm25DescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfi? DfiValue { get; set; } + private SettingsSimilarityDfiDescriptor DfiDescriptor { get; set; } + private Action DfiDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfr? DfrValue { get; set; } + private SettingsSimilarityDfrDescriptor DfrDescriptor { get; set; } + private Action DfrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityIb? IbValue { get; set; } + private SettingsSimilarityIbDescriptor IbDescriptor { get; set; } + private Action IbDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmd? LmdValue { get; set; } + private SettingsSimilarityLmdDescriptor LmdDescriptor { get; set; } + private Action LmdDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmj? LmjValue { get; set; } + private SettingsSimilarityLmjDescriptor LmjDescriptor { get; set; } + private Action LmjDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityScriptedTfidf? ScriptedTfidfValue { get; set; } + private SettingsSimilarityScriptedTfidfDescriptor ScriptedTfidfDescriptor { get; set; } + private Action ScriptedTfidfDescriptorAction { get; set; } + + public SettingsSimilarityDescriptor Bm25(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityBm25? bm25) + { + Bm25Descriptor = null; + Bm25DescriptorAction = null; + Bm25Value = bm25; + return Self; + } + + public SettingsSimilarityDescriptor Bm25(SettingsSimilarityBm25Descriptor descriptor) + { + Bm25Value = null; + Bm25DescriptorAction = null; + Bm25Descriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Bm25(Action configure) + { + Bm25Value = null; + Bm25Descriptor = null; + Bm25DescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor Dfi(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfi? dfi) + { + DfiDescriptor = null; + DfiDescriptorAction = null; + DfiValue = dfi; + return Self; + } + + public SettingsSimilarityDescriptor Dfi(SettingsSimilarityDfiDescriptor descriptor) + { + DfiValue = null; + DfiDescriptorAction = null; + DfiDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Dfi(Action configure) + { + DfiValue = null; + DfiDescriptor = null; + DfiDescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor Dfr(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfr? dfr) + { + DfrDescriptor = null; + DfrDescriptorAction = null; + DfrValue = dfr; + return Self; + } + + public SettingsSimilarityDescriptor Dfr(SettingsSimilarityDfrDescriptor descriptor) + { + DfrValue = null; + DfrDescriptorAction = null; + DfrDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Dfr(Action configure) + { + DfrValue = null; + DfrDescriptor = null; + DfrDescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor Ib(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityIb? ib) + { + IbDescriptor = null; + IbDescriptorAction = null; + IbValue = ib; + return Self; + } + + public SettingsSimilarityDescriptor Ib(SettingsSimilarityIbDescriptor descriptor) + { + IbValue = null; + IbDescriptorAction = null; + IbDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Ib(Action configure) + { + IbValue = null; + IbDescriptor = null; + IbDescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor Lmd(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmd? lmd) + { + LmdDescriptor = null; + LmdDescriptorAction = null; + LmdValue = lmd; + return Self; + } + + public SettingsSimilarityDescriptor Lmd(SettingsSimilarityLmdDescriptor descriptor) + { + LmdValue = null; + LmdDescriptorAction = null; + LmdDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Lmd(Action configure) + { + LmdValue = null; + LmdDescriptor = null; + LmdDescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor Lmj(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmj? lmj) + { + LmjDescriptor = null; + LmjDescriptorAction = null; + LmjValue = lmj; + return Self; + } + + public SettingsSimilarityDescriptor Lmj(SettingsSimilarityLmjDescriptor descriptor) + { + LmjValue = null; + LmjDescriptorAction = null; + LmjDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor Lmj(Action configure) + { + LmjValue = null; + LmjDescriptor = null; + LmjDescriptorAction = configure; + return Self; + } + + public SettingsSimilarityDescriptor ScriptedTfidf(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityScriptedTfidf? scriptedTfidf) + { + ScriptedTfidfDescriptor = null; + ScriptedTfidfDescriptorAction = null; + ScriptedTfidfValue = scriptedTfidf; + return Self; + } + + public SettingsSimilarityDescriptor ScriptedTfidf(SettingsSimilarityScriptedTfidfDescriptor descriptor) + { + ScriptedTfidfValue = null; + ScriptedTfidfDescriptorAction = null; + ScriptedTfidfDescriptor = descriptor; + return Self; + } + + public SettingsSimilarityDescriptor ScriptedTfidf(Action configure) + { + ScriptedTfidfValue = null; + ScriptedTfidfDescriptor = null; + ScriptedTfidfDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (Bm25Descriptor is not null) + { + writer.WritePropertyName("bm25"); + JsonSerializer.Serialize(writer, Bm25Descriptor, options); + } + else if (Bm25DescriptorAction is not null) + { + writer.WritePropertyName("bm25"); + JsonSerializer.Serialize(writer, new SettingsSimilarityBm25Descriptor(Bm25DescriptorAction), options); + } + else if (Bm25Value is not null) + { + writer.WritePropertyName("bm25"); + JsonSerializer.Serialize(writer, Bm25Value, options); + } + + if (DfiDescriptor is not null) + { + writer.WritePropertyName("dfi"); + JsonSerializer.Serialize(writer, DfiDescriptor, options); + } + else if (DfiDescriptorAction is not null) + { + writer.WritePropertyName("dfi"); + JsonSerializer.Serialize(writer, new SettingsSimilarityDfiDescriptor(DfiDescriptorAction), options); + } + else if (DfiValue is not null) + { + writer.WritePropertyName("dfi"); + JsonSerializer.Serialize(writer, DfiValue, options); + } + + if (DfrDescriptor is not null) + { + writer.WritePropertyName("dfr"); + JsonSerializer.Serialize(writer, DfrDescriptor, options); + } + else if (DfrDescriptorAction is not null) + { + writer.WritePropertyName("dfr"); + JsonSerializer.Serialize(writer, new SettingsSimilarityDfrDescriptor(DfrDescriptorAction), options); + } + else if (DfrValue is not null) + { + writer.WritePropertyName("dfr"); + JsonSerializer.Serialize(writer, DfrValue, options); + } + + if (IbDescriptor is not null) + { + writer.WritePropertyName("ib"); + JsonSerializer.Serialize(writer, IbDescriptor, options); + } + else if (IbDescriptorAction is not null) + { + writer.WritePropertyName("ib"); + JsonSerializer.Serialize(writer, new SettingsSimilarityIbDescriptor(IbDescriptorAction), options); + } + else if (IbValue is not null) + { + writer.WritePropertyName("ib"); + JsonSerializer.Serialize(writer, IbValue, options); + } + + if (LmdDescriptor is not null) + { + writer.WritePropertyName("lmd"); + JsonSerializer.Serialize(writer, LmdDescriptor, options); + } + else if (LmdDescriptorAction is not null) + { + writer.WritePropertyName("lmd"); + JsonSerializer.Serialize(writer, new SettingsSimilarityLmdDescriptor(LmdDescriptorAction), options); + } + else if (LmdValue is not null) + { + writer.WritePropertyName("lmd"); + JsonSerializer.Serialize(writer, LmdValue, options); + } + + if (LmjDescriptor is not null) + { + writer.WritePropertyName("lmj"); + JsonSerializer.Serialize(writer, LmjDescriptor, options); + } + else if (LmjDescriptorAction is not null) + { + writer.WritePropertyName("lmj"); + JsonSerializer.Serialize(writer, new SettingsSimilarityLmjDescriptor(LmjDescriptorAction), options); + } + else if (LmjValue is not null) + { + writer.WritePropertyName("lmj"); + JsonSerializer.Serialize(writer, LmjValue, options); + } + + if (ScriptedTfidfDescriptor is not null) + { + writer.WritePropertyName("scripted_tfidf"); + JsonSerializer.Serialize(writer, ScriptedTfidfDescriptor, options); + } + else if (ScriptedTfidfDescriptorAction is not null) + { + writer.WritePropertyName("scripted_tfidf"); + JsonSerializer.Serialize(writer, new SettingsSimilarityScriptedTfidfDescriptor(ScriptedTfidfDescriptorAction), options); + } + else if (ScriptedTfidfValue is not null) + { + writer.WritePropertyName("scripted_tfidf"); + JsonSerializer.Serialize(writer, ScriptedTfidfValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs new file mode 100644 index 00000000000..e2c1bb5eb05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityBm25 +{ + [JsonInclude, JsonPropertyName("b")] + public double b { get; set; } + [JsonInclude, JsonPropertyName("discount_overlaps")] + public bool DiscountOverlaps { get; set; } + [JsonInclude, JsonPropertyName("k1")] + public double K1 { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "BM25"; +} + +public sealed partial class SettingsSimilarityBm25Descriptor : SerializableDescriptor +{ + internal SettingsSimilarityBm25Descriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityBm25Descriptor() : base() + { + } + + private double bValue { get; set; } + private bool DiscountOverlapsValue { get; set; } + private double K1Value { get; set; } + + public SettingsSimilarityBm25Descriptor b(double b) + { + bValue = b; + return Self; + } + + public SettingsSimilarityBm25Descriptor DiscountOverlaps(bool discountOverlaps = true) + { + DiscountOverlapsValue = discountOverlaps; + return Self; + } + + public SettingsSimilarityBm25Descriptor K1(double k1) + { + K1Value = k1; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("b"); + writer.WriteNumberValue(bValue); + writer.WritePropertyName("discount_overlaps"); + writer.WriteBooleanValue(DiscountOverlapsValue); + writer.WritePropertyName("k1"); + writer.WriteNumberValue(K1Value); + writer.WritePropertyName("type"); + writer.WriteStringValue("BM25"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs new file mode 100644 index 00000000000..61870cdf198 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityDfi +{ + [JsonInclude, JsonPropertyName("independence_measure")] + public Elastic.Clients.Elasticsearch.Serverless.DFIIndependenceMeasure IndependenceMeasure { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "DFI"; +} + +public sealed partial class SettingsSimilarityDfiDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityDfiDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityDfiDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.DFIIndependenceMeasure IndependenceMeasureValue { get; set; } + + public SettingsSimilarityDfiDescriptor IndependenceMeasure(Elastic.Clients.Elasticsearch.Serverless.DFIIndependenceMeasure independenceMeasure) + { + IndependenceMeasureValue = independenceMeasure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("independence_measure"); + JsonSerializer.Serialize(writer, IndependenceMeasureValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("DFI"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs new file mode 100644 index 00000000000..5074f29611f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityDfr +{ + [JsonInclude, JsonPropertyName("after_effect")] + public Elastic.Clients.Elasticsearch.Serverless.DFRAfterEffect AfterEffect { get; set; } + [JsonInclude, JsonPropertyName("basic_model")] + public Elastic.Clients.Elasticsearch.Serverless.DFRBasicModel BasicModel { get; set; } + [JsonInclude, JsonPropertyName("normalization")] + public Elastic.Clients.Elasticsearch.Serverless.Normalization Normalization { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "DFR"; +} + +public sealed partial class SettingsSimilarityDfrDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityDfrDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityDfrDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.DFRAfterEffect AfterEffectValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DFRBasicModel BasicModelValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Normalization NormalizationValue { get; set; } + + public SettingsSimilarityDfrDescriptor AfterEffect(Elastic.Clients.Elasticsearch.Serverless.DFRAfterEffect afterEffect) + { + AfterEffectValue = afterEffect; + return Self; + } + + public SettingsSimilarityDfrDescriptor BasicModel(Elastic.Clients.Elasticsearch.Serverless.DFRBasicModel basicModel) + { + BasicModelValue = basicModel; + return Self; + } + + public SettingsSimilarityDfrDescriptor Normalization(Elastic.Clients.Elasticsearch.Serverless.Normalization normalization) + { + NormalizationValue = normalization; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("after_effect"); + JsonSerializer.Serialize(writer, AfterEffectValue, options); + writer.WritePropertyName("basic_model"); + JsonSerializer.Serialize(writer, BasicModelValue, options); + writer.WritePropertyName("normalization"); + JsonSerializer.Serialize(writer, NormalizationValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("DFR"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs new file mode 100644 index 00000000000..d926d09622a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs @@ -0,0 +1,86 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityIb +{ + [JsonInclude, JsonPropertyName("distribution")] + public Elastic.Clients.Elasticsearch.Serverless.IBDistribution Distribution { get; set; } + [JsonInclude, JsonPropertyName("lambda")] + public Elastic.Clients.Elasticsearch.Serverless.IBLambda Lambda { get; set; } + [JsonInclude, JsonPropertyName("normalization")] + public Elastic.Clients.Elasticsearch.Serverless.Normalization Normalization { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "IB"; +} + +public sealed partial class SettingsSimilarityIbDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityIbDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityIbDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IBDistribution DistributionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IBLambda LambdaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Normalization NormalizationValue { get; set; } + + public SettingsSimilarityIbDescriptor Distribution(Elastic.Clients.Elasticsearch.Serverless.IBDistribution distribution) + { + DistributionValue = distribution; + return Self; + } + + public SettingsSimilarityIbDescriptor Lambda(Elastic.Clients.Elasticsearch.Serverless.IBLambda lambda) + { + LambdaValue = lambda; + return Self; + } + + public SettingsSimilarityIbDescriptor Normalization(Elastic.Clients.Elasticsearch.Serverless.Normalization normalization) + { + NormalizationValue = normalization; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("distribution"); + JsonSerializer.Serialize(writer, DistributionValue, options); + writer.WritePropertyName("lambda"); + JsonSerializer.Serialize(writer, LambdaValue, options); + writer.WritePropertyName("normalization"); + JsonSerializer.Serialize(writer, NormalizationValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("IB"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs new file mode 100644 index 00000000000..0f3553d742f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityLmd +{ + [JsonInclude, JsonPropertyName("mu")] + public int Mu { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "LMDirichlet"; +} + +public sealed partial class SettingsSimilarityLmdDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityLmdDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityLmdDescriptor() : base() + { + } + + private int MuValue { get; set; } + + public SettingsSimilarityLmdDescriptor Mu(int mu) + { + MuValue = mu; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("mu"); + writer.WriteNumberValue(MuValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("LMDirichlet"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs new file mode 100644 index 00000000000..8e08aec839c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityLmj +{ + [JsonInclude, JsonPropertyName("lambda")] + public double Lambda { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "LMJelinekMercer"; +} + +public sealed partial class SettingsSimilarityLmjDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityLmjDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityLmjDescriptor() : base() + { + } + + private double LambdaValue { get; set; } + + public SettingsSimilarityLmjDescriptor Lambda(double lambda) + { + LambdaValue = lambda; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue); + writer.WritePropertyName("type"); + writer.WriteStringValue("LMJelinekMercer"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs new file mode 100644 index 00000000000..ea5b38ab980 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SettingsSimilarityScriptedTfidf +{ + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "scripted"; +} + +public sealed partial class SettingsSimilarityScriptedTfidfDescriptor : SerializableDescriptor +{ + internal SettingsSimilarityScriptedTfidfDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityScriptedTfidfDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + public SettingsSimilarityScriptedTfidfDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue("scripted"); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardCommit.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardCommit.g.cs new file mode 100644 index 00000000000..69c1039b6f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardCommit.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardCommit +{ + [JsonInclude, JsonPropertyName("generation")] + public int Generation { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("num_docs")] + public long NumDocs { get; init; } + [JsonInclude, JsonPropertyName("user_data")] + public IReadOnlyDictionary UserData { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs new file mode 100644 index 00000000000..f437e50f6ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardFileSizeInfo +{ + [JsonInclude, JsonPropertyName("average_size_in_bytes")] + public long? AverageSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("max_size_in_bytes")] + public long? MaxSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("min_size_in_bytes")] + public long? MinSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public long SizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardLease.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardLease.g.cs new file mode 100644 index 00000000000..0c2e555d599 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardLease.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardLease +{ + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("retaining_seq_no")] + public long RetainingSeqNo { get; init; } + [JsonInclude, JsonPropertyName("source")] + public string Source { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardPath.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardPath.g.cs new file mode 100644 index 00000000000..27d82a2818b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardPath.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardPath +{ + [JsonInclude, JsonPropertyName("data_path")] + public string DataPath { get; init; } + [JsonInclude, JsonPropertyName("is_custom_data_path")] + public bool IsCustomDataPath { get; init; } + [JsonInclude, JsonPropertyName("state_path")] + public string StatePath { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardQueryCache.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardQueryCache.g.cs new file mode 100644 index 00000000000..b5f277c442d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardQueryCache.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardQueryCache +{ + [JsonInclude, JsonPropertyName("cache_count")] + public long CacheCount { get; init; } + [JsonInclude, JsonPropertyName("cache_size")] + public long CacheSize { get; init; } + [JsonInclude, JsonPropertyName("evictions")] + public long Evictions { get; init; } + [JsonInclude, JsonPropertyName("hit_count")] + public long HitCount { get; init; } + [JsonInclude, JsonPropertyName("memory_size_in_bytes")] + public long MemorySizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("miss_count")] + public long MissCount { get; init; } + [JsonInclude, JsonPropertyName("total_count")] + public long TotalCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs new file mode 100644 index 00000000000..8b42e634c8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardRetentionLeases +{ + [JsonInclude, JsonPropertyName("leases")] + public IReadOnlyCollection Leases { get; init; } + [JsonInclude, JsonPropertyName("primary_term")] + public long PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRouting.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRouting.g.cs new file mode 100644 index 00000000000..c07c2615e56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRouting.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardRouting +{ + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("relocating_node")] + public string? RelocatingNode { get; init; } + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardRoutingState State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs new file mode 100644 index 00000000000..4b7e5a26ad4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardSequenceNumber +{ + [JsonInclude, JsonPropertyName("global_checkpoint")] + public long GlobalCheckpoint { get; init; } + [JsonInclude, JsonPropertyName("local_checkpoint")] + public long LocalCheckpoint { get; init; } + [JsonInclude, JsonPropertyName("max_seq_no")] + public long MaxSeqNo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs new file mode 100644 index 00000000000..65d802d371b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardStats +{ + [JsonInclude, JsonPropertyName("bulk")] + public Elastic.Clients.Elasticsearch.Serverless.BulkStats? Bulk { get; init; } + [JsonInclude, JsonPropertyName("commit")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardCommit? Commit { get; init; } + [JsonInclude, JsonPropertyName("completion")] + public Elastic.Clients.Elasticsearch.Serverless.CompletionStats? Completion { get; init; } + [JsonInclude, JsonPropertyName("docs")] + public Elastic.Clients.Elasticsearch.Serverless.DocStats? Docs { get; init; } + [JsonInclude, JsonPropertyName("fielddata")] + public Elastic.Clients.Elasticsearch.Serverless.FielddataStats? Fielddata { get; init; } + [JsonInclude, JsonPropertyName("flush")] + public Elastic.Clients.Elasticsearch.Serverless.FlushStats? Flush { get; init; } + [JsonInclude, JsonPropertyName("get")] + public Elastic.Clients.Elasticsearch.Serverless.GetStats? Get { get; init; } + [JsonInclude, JsonPropertyName("indexing")] + public Elastic.Clients.Elasticsearch.Serverless.IndexingStats? Indexing { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndicesStats? Indices { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingStats? Mappings { get; init; } + [JsonInclude, JsonPropertyName("merges")] + public Elastic.Clients.Elasticsearch.Serverless.MergesStats? Merges { get; init; } + [JsonInclude, JsonPropertyName("query_cache")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardQueryCache? QueryCache { get; init; } + [JsonInclude, JsonPropertyName("recovery")] + public Elastic.Clients.Elasticsearch.Serverless.RecoveryStats? Recovery { get; init; } + [JsonInclude, JsonPropertyName("refresh")] + public Elastic.Clients.Elasticsearch.Serverless.RefreshStats? Refresh { get; init; } + [JsonInclude, JsonPropertyName("request_cache")] + public Elastic.Clients.Elasticsearch.Serverless.RequestCacheStats? RequestCache { get; init; } + [JsonInclude, JsonPropertyName("retention_leases")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardRetentionLeases? RetentionLeases { get; init; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardRouting? Routing { get; init; } + [JsonInclude, JsonPropertyName("search")] + public Elastic.Clients.Elasticsearch.Serverless.SearchStats? Search { get; init; } + [JsonInclude, JsonPropertyName("segments")] + public Elastic.Clients.Elasticsearch.Serverless.SegmentsStats? Segments { get; init; } + [JsonInclude, JsonPropertyName("seq_no")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardSequenceNumber? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("shard_path")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardPath? ShardPath { get; init; } + [JsonInclude, JsonPropertyName("shards")] + [ReadOnlyIndexNameDictionaryConverter(typeof(object))] + public IReadOnlyDictionary? Shards { get; init; } + [JsonInclude, JsonPropertyName("store")] + public Elastic.Clients.Elasticsearch.Serverless.StoreStats? Store { get; init; } + [JsonInclude, JsonPropertyName("translog")] + public Elastic.Clients.Elasticsearch.Serverless.TranslogStats? Translog { get; init; } + [JsonInclude, JsonPropertyName("warmer")] + public Elastic.Clients.Elasticsearch.Serverless.WarmerStats? Warmer { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs new file mode 100644 index 00000000000..c75a82ef45e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs @@ -0,0 +1,34 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ShardsTotalStats +{ + [JsonInclude, JsonPropertyName("total_count")] + public long TotalCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs new file mode 100644 index 00000000000..c7bd819fec8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SlowlogSettings +{ + [JsonInclude, JsonPropertyName("level")] + public string? Level { get; set; } + [JsonInclude, JsonPropertyName("reformat")] + public bool? Reformat { get; set; } + [JsonInclude, JsonPropertyName("source")] + public int? Source { get; set; } + [JsonInclude, JsonPropertyName("threshold")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholds? Threshold { get; set; } +} + +public sealed partial class SlowlogSettingsDescriptor : SerializableDescriptor +{ + internal SlowlogSettingsDescriptor(Action configure) => configure.Invoke(this); + + public SlowlogSettingsDescriptor() : base() + { + } + + private string? LevelValue { get; set; } + private bool? ReformatValue { get; set; } + private int? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholds? ThresholdValue { get; set; } + private SlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } + + public SlowlogSettingsDescriptor Level(string? level) + { + LevelValue = level; + return Self; + } + + public SlowlogSettingsDescriptor Reformat(bool? reformat = true) + { + ReformatValue = reformat; + return Self; + } + + public SlowlogSettingsDescriptor Source(int? source) + { + SourceValue = source; + return Self; + } + + public SlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholds? threshold) + { + ThresholdDescriptor = null; + ThresholdDescriptorAction = null; + ThresholdValue = threshold; + return Self; + } + + public SlowlogSettingsDescriptor Threshold(SlowlogTresholdsDescriptor descriptor) + { + ThresholdValue = null; + ThresholdDescriptorAction = null; + ThresholdDescriptor = descriptor; + return Self; + } + + public SlowlogSettingsDescriptor Threshold(Action configure) + { + ThresholdValue = null; + ThresholdDescriptor = null; + ThresholdDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LevelValue)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(LevelValue); + } + + if (ReformatValue.HasValue) + { + writer.WritePropertyName("reformat"); + writer.WriteBooleanValue(ReformatValue.Value); + } + + if (SourceValue.HasValue) + { + writer.WritePropertyName("source"); + writer.WriteNumberValue(SourceValue.Value); + } + + if (ThresholdDescriptor is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdDescriptor, options); + } + else if (ThresholdDescriptorAction is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, new SlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + } + else if (ThresholdValue is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs new file mode 100644 index 00000000000..21a955e447e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SlowlogTresholdLevels +{ + [JsonInclude, JsonPropertyName("debug")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Debug { get; set; } + [JsonInclude, JsonPropertyName("info")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Info { get; set; } + [JsonInclude, JsonPropertyName("trace")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Trace { get; set; } + [JsonInclude, JsonPropertyName("warn")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Warn { get; set; } +} + +public sealed partial class SlowlogTresholdLevelsDescriptor : SerializableDescriptor +{ + internal SlowlogTresholdLevelsDescriptor(Action configure) => configure.Invoke(this); + + public SlowlogTresholdLevelsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DebugValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? InfoValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TraceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? WarnValue { get; set; } + + public SlowlogTresholdLevelsDescriptor Debug(Elastic.Clients.Elasticsearch.Serverless.Duration? debug) + { + DebugValue = debug; + return Self; + } + + public SlowlogTresholdLevelsDescriptor Info(Elastic.Clients.Elasticsearch.Serverless.Duration? info) + { + InfoValue = info; + return Self; + } + + public SlowlogTresholdLevelsDescriptor Trace(Elastic.Clients.Elasticsearch.Serverless.Duration? trace) + { + TraceValue = trace; + return Self; + } + + public SlowlogTresholdLevelsDescriptor Warn(Elastic.Clients.Elasticsearch.Serverless.Duration? warn) + { + WarnValue = warn; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DebugValue is not null) + { + writer.WritePropertyName("debug"); + JsonSerializer.Serialize(writer, DebugValue, options); + } + + if (InfoValue is not null) + { + writer.WritePropertyName("info"); + JsonSerializer.Serialize(writer, InfoValue, options); + } + + if (TraceValue is not null) + { + writer.WritePropertyName("trace"); + JsonSerializer.Serialize(writer, TraceValue, options); + } + + if (WarnValue is not null) + { + writer.WritePropertyName("warn"); + JsonSerializer.Serialize(writer, WarnValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs new file mode 100644 index 00000000000..d62b4aa5027 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SlowlogTresholds +{ + [JsonInclude, JsonPropertyName("fetch")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? Fetch { get; set; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? Query { get; set; } +} + +public sealed partial class SlowlogTresholdsDescriptor : SerializableDescriptor +{ + internal SlowlogTresholdsDescriptor(Action configure) => configure.Invoke(this); + + public SlowlogTresholdsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? FetchValue { get; set; } + private SlowlogTresholdLevelsDescriptor FetchDescriptor { get; set; } + private Action FetchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? QueryValue { get; set; } + private SlowlogTresholdLevelsDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? fetch) + { + FetchDescriptor = null; + FetchDescriptorAction = null; + FetchValue = fetch; + return Self; + } + + public SlowlogTresholdsDescriptor Fetch(SlowlogTresholdLevelsDescriptor descriptor) + { + FetchValue = null; + FetchDescriptorAction = null; + FetchDescriptor = descriptor; + return Self; + } + + public SlowlogTresholdsDescriptor Fetch(Action configure) + { + FetchValue = null; + FetchDescriptor = null; + FetchDescriptorAction = configure; + return Self; + } + + public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SlowlogTresholdsDescriptor Query(SlowlogTresholdLevelsDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SlowlogTresholdsDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchDescriptor is not null) + { + writer.WritePropertyName("fetch"); + JsonSerializer.Serialize(writer, FetchDescriptor, options); + } + else if (FetchDescriptorAction is not null) + { + writer.WritePropertyName("fetch"); + JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(FetchDescriptorAction), options); + } + else if (FetchValue is not null) + { + writer.WritePropertyName("fetch"); + JsonSerializer.Serialize(writer, FetchValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs new file mode 100644 index 00000000000..1c5cc43ef1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs @@ -0,0 +1,121 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SoftDeletes +{ + /// + /// Indicates whether soft deletes are enabled on the index. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("retention_lease")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLease? RetentionLease { get; set; } +} + +public sealed partial class SoftDeletesDescriptor : SerializableDescriptor +{ + internal SoftDeletesDescriptor(Action configure) => configure.Invoke(this); + + public SoftDeletesDescriptor() : base() + { + } + + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLease? RetentionLeaseValue { get; set; } + private RetentionLeaseDescriptor RetentionLeaseDescriptor { get; set; } + private Action RetentionLeaseDescriptorAction { get; set; } + + /// + /// Indicates whether soft deletes are enabled on the index. + /// + public SoftDeletesDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// 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.
+ ///
+ public SoftDeletesDescriptor RetentionLease(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLease? retentionLease) + { + RetentionLeaseDescriptor = null; + RetentionLeaseDescriptorAction = null; + RetentionLeaseValue = retentionLease; + return Self; + } + + public SoftDeletesDescriptor RetentionLease(RetentionLeaseDescriptor descriptor) + { + RetentionLeaseValue = null; + RetentionLeaseDescriptorAction = null; + RetentionLeaseDescriptor = descriptor; + return Self; + } + + public SoftDeletesDescriptor RetentionLease(Action configure) + { + RetentionLeaseValue = null; + RetentionLeaseDescriptor = null; + RetentionLeaseDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (RetentionLeaseDescriptor is not null) + { + writer.WritePropertyName("retention_lease"); + JsonSerializer.Serialize(writer, RetentionLeaseDescriptor, options); + } + else if (RetentionLeaseDescriptorAction is not null) + { + writer.WritePropertyName("retention_lease"); + JsonSerializer.Serialize(writer, new RetentionLeaseDescriptor(RetentionLeaseDescriptorAction), options); + } + else if (RetentionLeaseValue is not null) + { + writer.WritePropertyName("retention_lease"); + JsonSerializer.Serialize(writer, RetentionLeaseValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Storage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Storage.g.cs new file mode 100644 index 00000000000..3f7891890a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Storage.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Storage +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("allow_mmap")] + public bool? AllowMmap { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageType Type { get; set; } +} + +public sealed partial class StorageDescriptor : SerializableDescriptor +{ + internal StorageDescriptor(Action configure) => configure.Invoke(this); + + public StorageDescriptor() : base() + { + } + + private bool? AllowMmapValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageType TypeValue { get; set; } + + /// + /// 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.
+ ///
+ public StorageDescriptor AllowMmap(bool? allowMmap = true) + { + AllowMmapValue = allowMmap; + return Self; + } + + public StorageDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowMmapValue.HasValue) + { + writer.WritePropertyName("allow_mmap"); + writer.WriteBooleanValue(AllowMmapValue.Value); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Template.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Template.g.cs new file mode 100644 index 00000000000..d5eee844bc2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Template.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Template +{ + [JsonInclude, JsonPropertyName("aliases")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Alias))] + public IReadOnlyDictionary Aliases { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping Mappings { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings Settings { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TemplateMapping.g.cs new file mode 100644 index 00000000000..86ee14af79c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TemplateMapping.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class TemplateMapping +{ + [JsonInclude, JsonPropertyName("aliases")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.Alias))] + public IReadOnlyDictionary Aliases { get; init; } + [JsonInclude, JsonPropertyName("index_patterns")] + public IReadOnlyCollection IndexPatterns { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping Mappings { get; init; } + [JsonInclude, JsonPropertyName("order")] + public int Order { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public IReadOnlyDictionary Settings { get; init; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs new file mode 100644 index 00000000000..4b98a3f7b01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs @@ -0,0 +1,158 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class Translog +{ + /// + /// Whether or not to `fsync` and commit the translog after every index, delete, update, or bulk request. + /// + [JsonInclude, JsonPropertyName("durability")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDurability? Durability { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("flush_threshold_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? FlushThresholdSize { get; set; } + [JsonInclude, JsonPropertyName("retention")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogRetention? Retention { get; set; } + + /// + /// How often the translog is fsynced to disk and committed, regardless of write operations.
Values less than 100ms are not allowed.
+ ///
+ [JsonInclude, JsonPropertyName("sync_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? SyncInterval { get; set; } +} + +public sealed partial class TranslogDescriptor : SerializableDescriptor +{ + internal TranslogDescriptor(Action configure) => configure.Invoke(this); + + public TranslogDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDurability? DurabilityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? FlushThresholdSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogRetention? RetentionValue { get; set; } + private TranslogRetentionDescriptor RetentionDescriptor { get; set; } + private Action RetentionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? SyncIntervalValue { get; set; } + + /// + /// Whether or not to `fsync` and commit the translog after every index, delete, update, or bulk request. + /// + public TranslogDescriptor Durability(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDurability? durability) + { + DurabilityValue = durability; + return Self; + } + + /// + /// 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.
+ ///
+ public TranslogDescriptor FlushThresholdSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? flushThresholdSize) + { + FlushThresholdSizeValue = flushThresholdSize; + return Self; + } + + public TranslogDescriptor Retention(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogRetention? retention) + { + RetentionDescriptor = null; + RetentionDescriptorAction = null; + RetentionValue = retention; + return Self; + } + + public TranslogDescriptor Retention(TranslogRetentionDescriptor descriptor) + { + RetentionValue = null; + RetentionDescriptorAction = null; + RetentionDescriptor = descriptor; + return Self; + } + + public TranslogDescriptor Retention(Action configure) + { + RetentionValue = null; + RetentionDescriptor = null; + RetentionDescriptorAction = configure; + return Self; + } + + /// + /// How often the translog is fsynced to disk and committed, regardless of write operations.
Values less than 100ms are not allowed.
+ ///
+ public TranslogDescriptor SyncInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? syncInterval) + { + SyncIntervalValue = syncInterval; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DurabilityValue is not null) + { + writer.WritePropertyName("durability"); + JsonSerializer.Serialize(writer, DurabilityValue, options); + } + + if (FlushThresholdSizeValue is not null) + { + writer.WritePropertyName("flush_threshold_size"); + JsonSerializer.Serialize(writer, FlushThresholdSizeValue, options); + } + + if (RetentionDescriptor is not null) + { + writer.WritePropertyName("retention"); + JsonSerializer.Serialize(writer, RetentionDescriptor, options); + } + else if (RetentionDescriptorAction is not null) + { + writer.WritePropertyName("retention"); + JsonSerializer.Serialize(writer, new TranslogRetentionDescriptor(RetentionDescriptorAction), options); + } + else if (RetentionValue is not null) + { + writer.WritePropertyName("retention"); + JsonSerializer.Serialize(writer, RetentionValue, options); + } + + if (SyncIntervalValue is not null) + { + writer.WritePropertyName("sync_interval"); + JsonSerializer.Serialize(writer, SyncIntervalValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogRetention.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogRetention.g.cs new file mode 100644 index 00000000000..4f1e2ab503b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogRetention.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class TranslogRetention +{ + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("age")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Age { get; set; } + + /// + /// 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.
+ ///
+ [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Size { get; set; } +} + +public sealed partial class TranslogRetentionDescriptor : SerializableDescriptor +{ + internal TranslogRetentionDescriptor(Action configure) => configure.Invoke(this); + + public TranslogRetentionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? AgeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? SizeValue { get; set; } + + /// + /// 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.
+ ///
+ public TranslogRetentionDescriptor Age(Elastic.Clients.Elasticsearch.Serverless.Duration? age) + { + AgeValue = age; + return Self; + } + + /// + /// 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.
+ ///
+ public TranslogRetentionDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.ByteSize? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AgeValue is not null) + { + writer.WritePropertyName("age"); + JsonSerializer.Serialize(writer, AgeValue, options); + } + + if (SizeValue is not null) + { + writer.WritePropertyName("size"); + JsonSerializer.Serialize(writer, SizeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexingStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexingStats.g.cs new file mode 100644 index 00000000000..7b00176e9bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexingStats.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class IndexingStats +{ + [JsonInclude, JsonPropertyName("delete_current")] + public long DeleteCurrent { get; init; } + [JsonInclude, JsonPropertyName("delete_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? DeleteTime { get; init; } + [JsonInclude, JsonPropertyName("delete_time_in_millis")] + public long DeleteTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("delete_total")] + public long DeleteTotal { get; init; } + [JsonInclude, JsonPropertyName("index_current")] + public long IndexCurrent { get; init; } + [JsonInclude, JsonPropertyName("index_failed")] + public long IndexFailed { get; init; } + [JsonInclude, JsonPropertyName("index_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? IndexTime { get; init; } + [JsonInclude, JsonPropertyName("index_time_in_millis")] + public long IndexTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("index_total")] + public long IndexTotal { get; init; } + [JsonInclude, JsonPropertyName("is_throttled")] + public bool IsThrottled { get; init; } + [JsonInclude, JsonPropertyName("noop_update_total")] + public long NoopUpdateTotal { get; init; } + [JsonInclude, JsonPropertyName("throttle_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("throttle_time_in_millis")] + public long ThrottleTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("types")] + public IReadOnlyDictionary? Types { get; init; } + [JsonInclude, JsonPropertyName("write_load")] + public double? WriteLoad { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs new file mode 100644 index 00000000000..0a701957079 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs @@ -0,0 +1,446 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class AppendProcessor +{ + /// + /// If `false`, the processor does not append values already present in the field. + /// + [JsonInclude, JsonPropertyName("allow_duplicates")] + public bool? AllowDuplicates { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The value to be appended. Supports template snippets. + /// + [JsonInclude, JsonPropertyName("value")] + public ICollection Value { get; set; } + + public static implicit operator Processor(AppendProcessor appendProcessor) => Ingest.Processor.Append(appendProcessor); +} + +public sealed partial class AppendProcessorDescriptor : SerializableDescriptor> +{ + internal AppendProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public AppendProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private bool? AllowDuplicatesValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + private ICollection ValueValue { get; set; } + + public AppendProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public AppendProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public AppendProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public AppendProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// If `false`, the processor does not append values already present in the field. + /// + public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicates = true) + { + AllowDuplicatesValue = allowDuplicates; + return Self; + } + + public AppendProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AppendProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public AppendProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The value to be appended. Supports template snippets. + /// + public AppendProcessorDescriptor Value(ICollection value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (AllowDuplicatesValue.HasValue) + { + writer.WritePropertyName("allow_duplicates"); + writer.WriteBooleanValue(AllowDuplicatesValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class AppendProcessorDescriptor : SerializableDescriptor +{ + internal AppendProcessorDescriptor(Action configure) => configure.Invoke(this); + + public AppendProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private bool? AllowDuplicatesValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + private ICollection ValueValue { get; set; } + + public AppendProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public AppendProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public AppendProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public AppendProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// If `false`, the processor does not append values already present in the field. + /// + public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicates = true) + { + AllowDuplicatesValue = allowDuplicates; + return Self; + } + + public AppendProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AppendProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public AppendProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The value to be appended. Supports template snippets. + /// + public AppendProcessorDescriptor Value(ICollection value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (AllowDuplicatesValue.HasValue) + { + writer.WritePropertyName("allow_duplicates"); + writer.WriteBooleanValue(AllowDuplicatesValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs new file mode 100644 index 00000000000..a35aeb9fa1e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs @@ -0,0 +1,661 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class AttachmentProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to get the base64 encoded field from. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and field does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// The number of chars being used for extraction to prevent huge fields.
Use `-1` for no limit.
+ ///
+ [JsonInclude, JsonPropertyName("indexed_chars")] + public long? IndexedChars { get; set; } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + [JsonInclude, JsonPropertyName("indexed_chars_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsField { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Array of properties to select to be stored.
Can be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`.
+ ///
+ [JsonInclude, JsonPropertyName("properties")] + public ICollection? Properties { get; set; } + + /// + /// Field containing the name of the resource to decode.
If specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection.
+ ///
+ [JsonInclude, JsonPropertyName("resource_name")] + public string? ResourceName { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field that will hold the attachment information. + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(AttachmentProcessor attachmentProcessor) => Ingest.Processor.Attachment(attachmentProcessor); +} + +public sealed partial class AttachmentProcessorDescriptor : SerializableDescriptor> +{ + internal AttachmentProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public AttachmentProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private long? IndexedCharsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsFieldValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? ResourceNameValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public AttachmentProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AttachmentProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and field does not exist, the processor quietly exits without modifying the document. + /// + public AttachmentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The number of chars being used for extraction to prevent huge fields.
Use `-1` for no limit.
+ ///
+ public AttachmentProcessorDescriptor IndexedChars(long? indexedChars) + { + IndexedCharsValue = indexedChars; + return Self; + } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + public AttachmentProcessorDescriptor IndexedCharsField(Elastic.Clients.Elasticsearch.Serverless.Field? indexedCharsField) + { + IndexedCharsFieldValue = indexedCharsField; + return Self; + } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + public AttachmentProcessorDescriptor IndexedCharsField(Expression> indexedCharsField) + { + IndexedCharsFieldValue = indexedCharsField; + return Self; + } + + /// + /// Array of properties to select to be stored.
Can be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`.
+ ///
+ public AttachmentProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + /// + /// Field containing the name of the resource to decode.
If specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection.
+ ///
+ public AttachmentProcessorDescriptor ResourceName(string? resourceName) + { + ResourceNameValue = resourceName; + return Self; + } + + public AttachmentProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the attachment information. + /// + public AttachmentProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the attachment information. + /// + public AttachmentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (IndexedCharsValue.HasValue) + { + writer.WritePropertyName("indexed_chars"); + writer.WriteNumberValue(IndexedCharsValue.Value); + } + + if (IndexedCharsFieldValue is not null) + { + writer.WritePropertyName("indexed_chars_field"); + JsonSerializer.Serialize(writer, IndexedCharsFieldValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(ResourceNameValue)) + { + writer.WritePropertyName("resource_name"); + writer.WriteStringValue(ResourceNameValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AttachmentProcessorDescriptor : SerializableDescriptor +{ + internal AttachmentProcessorDescriptor(Action configure) => configure.Invoke(this); + + public AttachmentProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private long? IndexedCharsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsFieldValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? ResourceNameValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public AttachmentProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public AttachmentProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public AttachmentProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and field does not exist, the processor quietly exits without modifying the document. + /// + public AttachmentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The number of chars being used for extraction to prevent huge fields.
Use `-1` for no limit.
+ ///
+ public AttachmentProcessorDescriptor IndexedChars(long? indexedChars) + { + IndexedCharsValue = indexedChars; + return Self; + } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + public AttachmentProcessorDescriptor IndexedCharsField(Elastic.Clients.Elasticsearch.Serverless.Field? indexedCharsField) + { + IndexedCharsFieldValue = indexedCharsField; + return Self; + } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + public AttachmentProcessorDescriptor IndexedCharsField(Expression> indexedCharsField) + { + IndexedCharsFieldValue = indexedCharsField; + return Self; + } + + /// + /// Field name from which you can overwrite the number of chars being used for extraction. + /// + public AttachmentProcessorDescriptor IndexedCharsField(Expression> indexedCharsField) + { + IndexedCharsFieldValue = indexedCharsField; + return Self; + } + + /// + /// Array of properties to select to be stored.
Can be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`.
+ ///
+ public AttachmentProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + /// + /// Field containing the name of the resource to decode.
If specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection.
+ ///
+ public AttachmentProcessorDescriptor ResourceName(string? resourceName) + { + ResourceNameValue = resourceName; + return Self; + } + + public AttachmentProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the attachment information. + /// + public AttachmentProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the attachment information. + /// + public AttachmentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the attachment information. + /// + public AttachmentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (IndexedCharsValue.HasValue) + { + writer.WritePropertyName("indexed_chars"); + writer.WriteNumberValue(IndexedCharsValue.Value); + } + + if (IndexedCharsFieldValue is not null) + { + writer.WritePropertyName("indexed_chars_field"); + JsonSerializer.Serialize(writer, IndexedCharsFieldValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(ResourceNameValue)) + { + writer.WritePropertyName("resource_name"); + writer.WriteStringValue(ResourceNameValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs new file mode 100644 index 00000000000..c867d5ecb45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class BytesProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to convert. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(BytesProcessor bytesProcessor) => Ingest.Processor.Bytes(bytesProcessor); +} + +public sealed partial class BytesProcessorDescriptor : SerializableDescriptor> +{ + internal BytesProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public BytesProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public BytesProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public BytesProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public BytesProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public BytesProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public BytesProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public BytesProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public BytesProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public BytesProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public BytesProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class BytesProcessorDescriptor : SerializableDescriptor +{ + internal BytesProcessorDescriptor(Action configure) => configure.Invoke(this); + + public BytesProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public BytesProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public BytesProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public BytesProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public BytesProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public BytesProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public BytesProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public BytesProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public BytesProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public BytesProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public BytesProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs new file mode 100644 index 00000000000..c5f2dca0c2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs @@ -0,0 +1,542 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class CircleProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`). + /// + [JsonInclude, JsonPropertyName("error_distance")] + public double ErrorDistance { get; set; } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Which field mapping type is to be used when processing the circle: `geo_shape` or `shape`. + /// + [JsonInclude, JsonPropertyName("shape_type")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType ShapeType { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(CircleProcessor circleProcessor) => Ingest.Processor.Circle(circleProcessor); +} + +public sealed partial class CircleProcessorDescriptor : SerializableDescriptor> +{ + internal CircleProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public CircleProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private double ErrorDistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType ShapeTypeValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public CircleProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CircleProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CircleProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CircleProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public CircleProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`). + /// + public CircleProcessorDescriptor ErrorDistance(double errorDistance) + { + ErrorDistanceValue = errorDistance; + return Self; + } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + public CircleProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + public CircleProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CircleProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Which field mapping type is to be used when processing the circle: `geo_shape` or `shape`. + /// + public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType shapeType) + { + ShapeTypeValue = shapeType; + return Self; + } + + public CircleProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ public CircleProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ public CircleProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("error_distance"); + writer.WriteNumberValue(ErrorDistanceValue); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("shape_type"); + JsonSerializer.Serialize(writer, ShapeTypeValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CircleProcessorDescriptor : SerializableDescriptor +{ + internal CircleProcessorDescriptor(Action configure) => configure.Invoke(this); + + public CircleProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private double ErrorDistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType ShapeTypeValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public CircleProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CircleProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CircleProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CircleProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public CircleProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`). + /// + public CircleProcessorDescriptor ErrorDistance(double errorDistance) + { + ErrorDistanceValue = errorDistance; + return Self; + } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + public CircleProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + public CircleProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. + /// + public CircleProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CircleProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Which field mapping type is to be used when processing the circle: `geo_shape` or `shape`. + /// + public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType shapeType) + { + ShapeTypeValue = shapeType; + return Self; + } + + public CircleProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ public CircleProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ public CircleProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the polygon shape to
By default, the field is updated in-place.
+ ///
+ public CircleProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("error_distance"); + writer.WriteNumberValue(ErrorDistanceValue); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("shape_type"); + JsonSerializer.Serialize(writer, ShapeTypeValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs new file mode 100644 index 00000000000..8840a82a225 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs @@ -0,0 +1,512 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class ConvertProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field whose value is to be converted. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + /// + /// The type to convert the existing value to. + /// + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertType Type { get; set; } + + public static implicit operator Processor(ConvertProcessor convertProcessor) => Ingest.Processor.Convert(convertProcessor); +} + +public sealed partial class ConvertProcessorDescriptor : SerializableDescriptor> +{ + internal ConvertProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public ConvertProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertType TypeValue { get; set; } + + public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public ConvertProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ConvertProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public ConvertProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ public ConvertProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ public ConvertProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The type to convert the existing value to. + /// + public ConvertProcessorDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class ConvertProcessorDescriptor : SerializableDescriptor +{ + internal ConvertProcessorDescriptor(Action configure) => configure.Invoke(this); + + public ConvertProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertType TypeValue { get; set; } + + public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ConvertProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public ConvertProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ConvertProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public ConvertProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ public ConvertProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ public ConvertProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the `field` is updated in-place.
+ ///
+ public ConvertProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The type to convert the existing value to. + /// + public ConvertProcessorDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs new file mode 100644 index 00000000000..44f2cd59dbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs @@ -0,0 +1,599 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class CsvProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Value used to fill empty fields.
Empty fields are skipped if this is not provided.
An empty field is one with no value (2 consecutive separators) or empty quotes (`""`).
+ ///
+ [JsonInclude, JsonPropertyName("empty_value")] + public object? EmptyValue { get; set; } + + /// + /// The field to extract data from. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Quote used in CSV, has to be single character string. + /// + [JsonInclude, JsonPropertyName("quote")] + public string? Quote { get; set; } + + /// + /// Separator used in CSV, has to be single character string. + /// + [JsonInclude, JsonPropertyName("separator")] + public string? Separator { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The array of fields to assign extracted values to. + /// + [JsonInclude, JsonPropertyName("target_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields TargetFields { get; set; } + + /// + /// Trim whitespaces in unquoted fields. + /// + [JsonInclude, JsonPropertyName("trim")] + public bool? Trim { get; set; } + + public static implicit operator Processor(CsvProcessor csvProcessor) => Ingest.Processor.Csv(csvProcessor); +} + +public sealed partial class CsvProcessorDescriptor : SerializableDescriptor> +{ + internal CsvProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public CsvProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private object? EmptyValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? QuoteValue { get; set; } + private string? SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields TargetFieldsValue { get; set; } + private bool? TrimValue { get; set; } + + public CsvProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CsvProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CsvProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CsvProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public CsvProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Value used to fill empty fields.
Empty fields are skipped if this is not provided.
An empty field is one with no value (2 consecutive separators) or empty quotes (`""`).
+ ///
+ public CsvProcessorDescriptor EmptyValue(object? emptyValue) + { + EmptyValueValue = emptyValue; + return Self; + } + + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CsvProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Quote used in CSV, has to be single character string. + /// + public CsvProcessorDescriptor Quote(string? quote) + { + QuoteValue = quote; + return Self; + } + + /// + /// Separator used in CSV, has to be single character string. + /// + public CsvProcessorDescriptor Separator(string? separator) + { + SeparatorValue = separator; + return Self; + } + + public CsvProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The array of fields to assign extracted values to. + /// + public CsvProcessorDescriptor TargetFields(Elastic.Clients.Elasticsearch.Serverless.Fields targetFields) + { + TargetFieldsValue = targetFields; + return Self; + } + + /// + /// Trim whitespaces in unquoted fields. + /// + public CsvProcessorDescriptor Trim(bool? trim = true) + { + TrimValue = trim; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (EmptyValueValue is not null) + { + writer.WritePropertyName("empty_value"); + JsonSerializer.Serialize(writer, EmptyValueValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(QuoteValue)) + { + writer.WritePropertyName("quote"); + writer.WriteStringValue(QuoteValue); + } + + if (!string.IsNullOrEmpty(SeparatorValue)) + { + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_fields"); + JsonSerializer.Serialize(writer, TargetFieldsValue, options); + if (TrimValue.HasValue) + { + writer.WritePropertyName("trim"); + writer.WriteBooleanValue(TrimValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CsvProcessorDescriptor : SerializableDescriptor +{ + internal CsvProcessorDescriptor(Action configure) => configure.Invoke(this); + + public CsvProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private object? EmptyValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? QuoteValue { get; set; } + private string? SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields TargetFieldsValue { get; set; } + private bool? TrimValue { get; set; } + + public CsvProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CsvProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CsvProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CsvProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public CsvProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Value used to fill empty fields.
Empty fields are skipped if this is not provided.
An empty field is one with no value (2 consecutive separators) or empty quotes (`""`).
+ ///
+ public CsvProcessorDescriptor EmptyValue(object? emptyValue) + { + EmptyValueValue = emptyValue; + return Self; + } + + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CsvProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Quote used in CSV, has to be single character string. + /// + public CsvProcessorDescriptor Quote(string? quote) + { + QuoteValue = quote; + return Self; + } + + /// + /// Separator used in CSV, has to be single character string. + /// + public CsvProcessorDescriptor Separator(string? separator) + { + SeparatorValue = separator; + return Self; + } + + public CsvProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The array of fields to assign extracted values to. + /// + public CsvProcessorDescriptor TargetFields(Elastic.Clients.Elasticsearch.Serverless.Fields targetFields) + { + TargetFieldsValue = targetFields; + return Self; + } + + /// + /// Trim whitespaces in unquoted fields. + /// + public CsvProcessorDescriptor Trim(bool? trim = true) + { + TrimValue = trim; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (EmptyValueValue is not null) + { + writer.WritePropertyName("empty_value"); + JsonSerializer.Serialize(writer, EmptyValueValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(QuoteValue)) + { + writer.WritePropertyName("quote"); + writer.WriteStringValue(QuoteValue); + } + + if (!string.IsNullOrEmpty(SeparatorValue)) + { + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_fields"); + JsonSerializer.Serialize(writer, TargetFieldsValue, options); + if (TrimValue.HasValue) + { + writer.WritePropertyName("trim"); + writer.WriteBooleanValue(TrimValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs new file mode 100644 index 00000000000..dcef482bf91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs @@ -0,0 +1,590 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DateIndexNameProcessor +{ + /// + /// An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ [JsonInclude, JsonPropertyName("date_formats")] + public ICollection DateFormats { get; set; } + + /// + /// How to round the date when formatting the date into the index name. Valid values are:
`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("date_rounding")] + public string DateRounding { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to get the date or timestamp from. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// The format to be used when printing the parsed date into the index name.
A valid java time pattern is expected here.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("index_name_format")] + public string? IndexNameFormat { get; set; } + + /// + /// A prefix of the index name to be prepended before the printed date.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("index_name_prefix")] + public string? IndexNamePrefix { get; set; } + + /// + /// The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. + /// + [JsonInclude, JsonPropertyName("locale")] + public string? Locale { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + [JsonInclude, JsonPropertyName("timezone")] + public string? Timezone { get; set; } + + public static implicit operator Processor(DateIndexNameProcessor dateIndexNameProcessor) => Ingest.Processor.DateIndexName(dateIndexNameProcessor); +} + +public sealed partial class DateIndexNameProcessorDescriptor : SerializableDescriptor> +{ + internal DateIndexNameProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DateIndexNameProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private ICollection DateFormatsValue { get; set; } + private string DateRoundingValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? IndexNameFormatValue { get; set; } + private string? IndexNamePrefixValue { get; set; } + private string? LocaleValue { get; set; } + private string? TagValue { get; set; } + private string? TimezoneValue { get; set; } + + public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ public DateIndexNameProcessorDescriptor DateFormats(ICollection dateFormats) + { + DateFormatsValue = dateFormats; + return Self; + } + + /// + /// How to round the date when formatting the date into the index name. Valid values are:
`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor DateRounding(string dateRounding) + { + DateRoundingValue = dateRounding; + return Self; + } + + public DateIndexNameProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateIndexNameProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The format to be used when printing the parsed date into the index name.
A valid java time pattern is expected here.
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor IndexNameFormat(string? indexNameFormat) + { + IndexNameFormatValue = indexNameFormat; + return Self; + } + + /// + /// A prefix of the index name to be prepended before the printed date.
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor IndexNamePrefix(string? indexNamePrefix) + { + IndexNamePrefixValue = indexNamePrefix; + return Self; + } + + /// + /// The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. + /// + public DateIndexNameProcessorDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DateIndexNameProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + public DateIndexNameProcessorDescriptor Timezone(string? timezone) + { + TimezoneValue = timezone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + writer.WritePropertyName("date_formats"); + JsonSerializer.Serialize(writer, DateFormatsValue, options); + writer.WritePropertyName("date_rounding"); + writer.WriteStringValue(DateRoundingValue); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(IndexNameFormatValue)) + { + writer.WritePropertyName("index_name_format"); + writer.WriteStringValue(IndexNameFormatValue); + } + + if (!string.IsNullOrEmpty(IndexNamePrefixValue)) + { + writer.WritePropertyName("index_name_prefix"); + writer.WriteStringValue(IndexNamePrefixValue); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (!string.IsNullOrEmpty(TimezoneValue)) + { + writer.WritePropertyName("timezone"); + writer.WriteStringValue(TimezoneValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateIndexNameProcessorDescriptor : SerializableDescriptor +{ + internal DateIndexNameProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DateIndexNameProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private ICollection DateFormatsValue { get; set; } + private string DateRoundingValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? IndexNameFormatValue { get; set; } + private string? IndexNamePrefixValue { get; set; } + private string? LocaleValue { get; set; } + private string? TagValue { get; set; } + private string? TimezoneValue { get; set; } + + public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DateIndexNameProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ public DateIndexNameProcessorDescriptor DateFormats(ICollection dateFormats) + { + DateFormatsValue = dateFormats; + return Self; + } + + /// + /// How to round the date when formatting the date into the index name. Valid values are:
`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor DateRounding(string dateRounding) + { + DateRoundingValue = dateRounding; + return Self; + } + + public DateIndexNameProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateIndexNameProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The format to be used when printing the parsed date into the index name.
A valid java time pattern is expected here.
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor IndexNameFormat(string? indexNameFormat) + { + IndexNameFormatValue = indexNameFormat; + return Self; + } + + /// + /// A prefix of the index name to be prepended before the printed date.
Supports template snippets.
+ ///
+ public DateIndexNameProcessorDescriptor IndexNamePrefix(string? indexNamePrefix) + { + IndexNamePrefixValue = indexNamePrefix; + return Self; + } + + /// + /// The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. + /// + public DateIndexNameProcessorDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DateIndexNameProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + public DateIndexNameProcessorDescriptor Timezone(string? timezone) + { + TimezoneValue = timezone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + writer.WritePropertyName("date_formats"); + JsonSerializer.Serialize(writer, DateFormatsValue, options); + writer.WritePropertyName("date_rounding"); + writer.WriteStringValue(DateRoundingValue); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(IndexNameFormatValue)) + { + writer.WritePropertyName("index_name_format"); + writer.WriteStringValue(IndexNameFormatValue); + } + + if (!string.IsNullOrEmpty(IndexNamePrefixValue)) + { + writer.WritePropertyName("index_name_prefix"); + writer.WriteStringValue(IndexNamePrefixValue); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (!string.IsNullOrEmpty(TimezoneValue)) + { + writer.WritePropertyName("timezone"); + writer.WriteStringValue(TimezoneValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs new file mode 100644 index 00000000000..00787268799 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs @@ -0,0 +1,550 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DateProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to get the date from. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// An array of the expected date formats.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ [JsonInclude, JsonPropertyName("formats")] + public ICollection Formats { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// The locale to use when parsing the date, relevant when parsing month names or week days.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("locale")] + public string? Locale { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field that will hold the parsed date. + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + /// + /// The timezone to use when parsing the date.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("timezone")] + public string? Timezone { get; set; } + + public static implicit operator Processor(DateProcessor dateProcessor) => Ingest.Processor.Date(dateProcessor); +} + +public sealed partial class DateProcessorDescriptor : SerializableDescriptor> +{ + internal DateProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DateProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection FormatsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LocaleValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private string? TimezoneValue { get; set; } + + public DateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DateProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DateProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DateProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the date from. + /// + public DateProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date from. + /// + public DateProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// An array of the expected date formats.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ public DateProcessorDescriptor Formats(ICollection formats) + { + FormatsValue = formats; + return Self; + } + + public DateProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The locale to use when parsing the date, relevant when parsing month names or week days.
Supports template snippets.
+ ///
+ public DateProcessorDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the parsed date. + /// + public DateProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the parsed date. + /// + public DateProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The timezone to use when parsing the date.
Supports template snippets.
+ ///
+ public DateProcessorDescriptor Timezone(string? timezone) + { + TimezoneValue = timezone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("formats"); + JsonSerializer.Serialize(writer, FormatsValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimezoneValue)) + { + writer.WritePropertyName("timezone"); + writer.WriteStringValue(TimezoneValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateProcessorDescriptor : SerializableDescriptor +{ + internal DateProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DateProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private ICollection FormatsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LocaleValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private string? TimezoneValue { get; set; } + + public DateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DateProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DateProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DateProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the date from. + /// + public DateProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date from. + /// + public DateProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the date from. + /// + public DateProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// An array of the expected date formats.
Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
+ ///
+ public DateProcessorDescriptor Formats(ICollection formats) + { + FormatsValue = formats; + return Self; + } + + public DateProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The locale to use when parsing the date, relevant when parsing month names or week days.
Supports template snippets.
+ ///
+ public DateProcessorDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the parsed date. + /// + public DateProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the parsed date. + /// + public DateProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the parsed date. + /// + public DateProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The timezone to use when parsing the date.
Supports template snippets.
+ ///
+ public DateProcessorDescriptor Timezone(string? timezone) + { + TimezoneValue = timezone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("formats"); + JsonSerializer.Serialize(writer, FormatsValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimezoneValue)) + { + writer.WritePropertyName("timezone"); + writer.WriteStringValue(TimezoneValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs new file mode 100644 index 00000000000..8e420f2db42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs @@ -0,0 +1,484 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DissectProcessor +{ + /// + /// The character(s) that separate the appended fields. + /// + [JsonInclude, JsonPropertyName("append_separator")] + public string? AppendSeparator { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to dissect. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// The pattern to apply to the field. + /// + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(DissectProcessor dissectProcessor) => Ingest.Processor.Dissect(dissectProcessor); +} + +public sealed partial class DissectProcessorDescriptor : SerializableDescriptor> +{ + internal DissectProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DissectProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? AppendSeparatorValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string PatternValue { get; set; } + private string? TagValue { get; set; } + + public DissectProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DissectProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DissectProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DissectProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The character(s) that separate the appended fields. + /// + public DissectProcessorDescriptor AppendSeparator(string? appendSeparator) + { + AppendSeparatorValue = appendSeparator; + return Self; + } + + public DissectProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DissectProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The pattern to apply to the field. + /// + public DissectProcessorDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + public DissectProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(AppendSeparatorValue)) + { + writer.WritePropertyName("append_separator"); + writer.WriteStringValue(AppendSeparatorValue); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DissectProcessorDescriptor : SerializableDescriptor +{ + internal DissectProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DissectProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? AppendSeparatorValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string PatternValue { get; set; } + private string? TagValue { get; set; } + + public DissectProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DissectProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DissectProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DissectProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The character(s) that separate the appended fields. + /// + public DissectProcessorDescriptor AppendSeparator(string? appendSeparator) + { + AppendSeparatorValue = appendSeparator; + return Self; + } + + public DissectProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DissectProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The pattern to apply to the field. + /// + public DissectProcessorDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + public DissectProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(AppendSeparatorValue)) + { + writer.WritePropertyName("append_separator"); + writer.WriteStringValue(AppendSeparatorValue); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Document.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Document.g.cs new file mode 100644 index 00000000000..643c80f34f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Document.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class Document +{ + /// + /// Unique identifier for the document.
This ID must be unique within the `_index`.
+ ///
+ [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// Name of the index containing the document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// JSON body for the document. + /// + [JsonInclude, JsonPropertyName("_source")] + public object Source { get; set; } +} + +public sealed partial class DocumentDescriptor : SerializableDescriptor +{ + internal DocumentDescriptor(Action configure) => configure.Invoke(this); + + public DocumentDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private object SourceValue { get; set; } + + /// + /// Unique identifier for the document.
This ID must be unique within the `_index`.
+ ///
+ public DocumentDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Name of the index containing the document. + /// + public DocumentDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// JSON body for the document. + /// + public DocumentDescriptor Source(object source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs new file mode 100644 index 00000000000..c17f896dbf4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs @@ -0,0 +1,136 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +internal sealed partial class DocumentSimulationConverter : JsonConverter +{ + public override DocumentSimulation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + string id = default; + string index = default; + Elastic.Clients.Elasticsearch.Serverless.Ingest.IngestInfo ingest = default; + string? routing = default; + IReadOnlyDictionary source = default; + long? version = default; + Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_id") + { + id = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_index") + { + index = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_ingest") + { + ingest = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_routing") + { + routing = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_source") + { + source = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "_version") + { + version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_version_type") + { + versionType = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var value = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, value); + } + } + + return new DocumentSimulation { Id = id, Index = index, Ingest = ingest, Routing = routing, Source = source, Version = version, VersionType = versionType, Metadata = additionalProperties }; + } + + public override void Write(Utf8JsonWriter writer, DocumentSimulation value, JsonSerializerOptions options) + { + throw new NotImplementedException("'DocumentSimulation' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DocumentSimulationConverter))] +/// +/// The simulated document, with optional metadata. +/// +public sealed partial class DocumentSimulation +{ + /// + /// Unique identifier for the document. This ID must be unique within the `_index`. + /// + public string Id { get; init; } + + /// + /// Name of the index containing the document. + /// + public string Index { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Ingest.IngestInfo Ingest { get; init; } + + /// + /// Value used to send the document to a specific primary shard. + /// + public string? Routing { get; init; } + + /// + /// JSON body for the document. + /// + public IReadOnlyDictionary Source { get; init; } + [JsonConverter(typeof(StringifiedLongConverter))] + public long? Version { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get; init; } + public IReadOnlyDictionary Metadata { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs new file mode 100644 index 00000000000..98c5f14a939 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs @@ -0,0 +1,417 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DotExpanderProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// The field that contains the field to expand.
Only required if the field to expand is part another object field, because the `field` option can only understand leaf fields.
+ ///
+ [JsonInclude, JsonPropertyName("path")] + public string? Path { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(DotExpanderProcessor dotExpanderProcessor) => Ingest.Processor.DotExpander(dotExpanderProcessor); +} + +public sealed partial class DotExpanderProcessorDescriptor : SerializableDescriptor> +{ + internal DotExpanderProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DotExpanderProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? PathValue { get; set; } + private string? TagValue { get; set; } + + public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DotExpanderProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ public DotExpanderProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ public DotExpanderProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DotExpanderProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The field that contains the field to expand.
Only required if the field to expand is part another object field, because the `field` option can only understand leaf fields.
+ ///
+ public DotExpanderProcessorDescriptor Path(string? path) + { + PathValue = path; + return Self; + } + + public DotExpanderProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(PathValue)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(PathValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DotExpanderProcessorDescriptor : SerializableDescriptor +{ + internal DotExpanderProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DotExpanderProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? PathValue { get; set; } + private string? TagValue { get; set; } + + public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DotExpanderProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DotExpanderProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ public DotExpanderProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ public DotExpanderProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to expand into an object field.
If set to `*`, all top-level fields will be expanded.
+ ///
+ public DotExpanderProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DotExpanderProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The field that contains the field to expand.
Only required if the field to expand is part another object field, because the `field` option can only understand leaf fields.
+ ///
+ public DotExpanderProcessorDescriptor Path(string? path) + { + PathValue = path; + return Self; + } + + public DotExpanderProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(PathValue)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(PathValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs new file mode 100644 index 00000000000..b99a91a7621 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs @@ -0,0 +1,322 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class DropProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(DropProcessor dropProcessor) => Ingest.Processor.Drop(dropProcessor); +} + +public sealed partial class DropProcessorDescriptor : SerializableDescriptor> +{ + internal DropProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DropProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + + public DropProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DropProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DropProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DropProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DropProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public DropProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public DropProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DropProcessorDescriptor : SerializableDescriptor +{ + internal DropProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DropProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + + public DropProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public DropProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public DropProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public DropProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public DropProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public DropProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public DropProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs new file mode 100644 index 00000000000..bd015ff6bdb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs @@ -0,0 +1,618 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class EnrichProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// The maximum number of matched documents to include under the configured target field.
The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.
In order to avoid documents getting too large, the maximum allowed value is 128.
+ ///
+ [JsonInclude, JsonPropertyName("max_matches")] + public int? MaxMatches { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// If processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ [JsonInclude, JsonPropertyName("override")] + public bool? Override { get; set; } + + /// + /// The name of the enrich policy to use. + /// + [JsonInclude, JsonPropertyName("policy_name")] + public string PolicyName { get; set; } + + /// + /// A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
This option is only used for `geo_match` enrich policy types.
+ ///
+ [JsonInclude, JsonPropertyName("shape_relation")] + public Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? ShapeRelation { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field TargetField { get; set; } + + public static implicit operator Processor(EnrichProcessor enrichProcessor) => Ingest.Processor.Enrich(enrichProcessor); +} + +public sealed partial class EnrichProcessorDescriptor : SerializableDescriptor> +{ + internal EnrichProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public EnrichProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private int? MaxMatchesValue { get; set; } + private bool? OverrideValue { get; set; } + private string PolicyNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? ShapeRelationValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + + public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public EnrichProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public EnrichProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public EnrichProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The maximum number of matched documents to include under the configured target field.
The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.
In order to avoid documents getting too large, the maximum allowed value is 128.
+ ///
+ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) + { + MaxMatchesValue = maxMatches; + return Self; + } + + /// + /// If processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ public EnrichProcessorDescriptor Override(bool? overrideValue = true) + { + OverrideValue = overrideValue; + return Self; + } + + /// + /// The name of the enrich policy to use. + /// + public EnrichProcessorDescriptor PolicyName(string policyName) + { + PolicyNameValue = policyName; + return Self; + } + + /// + /// A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
This option is only used for `geo_match` enrich policy types.
+ ///
+ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? shapeRelation) + { + ShapeRelationValue = shapeRelation; + return Self; + } + + public EnrichProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (MaxMatchesValue.HasValue) + { + writer.WritePropertyName("max_matches"); + writer.WriteNumberValue(MaxMatchesValue.Value); + } + + if (OverrideValue.HasValue) + { + writer.WritePropertyName("override"); + writer.WriteBooleanValue(OverrideValue.Value); + } + + writer.WritePropertyName("policy_name"); + writer.WriteStringValue(PolicyNameValue); + if (ShapeRelationValue is not null) + { + writer.WritePropertyName("shape_relation"); + JsonSerializer.Serialize(writer, ShapeRelationValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class EnrichProcessorDescriptor : SerializableDescriptor +{ + internal EnrichProcessorDescriptor(Action configure) => configure.Invoke(this); + + public EnrichProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private int? MaxMatchesValue { get; set; } + private bool? OverrideValue { get; set; } + private string PolicyNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? ShapeRelationValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + + public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public EnrichProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public EnrichProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field in the input document that matches the policies match_field used to retrieve the enrichment data.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public EnrichProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public EnrichProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The maximum number of matched documents to include under the configured target field.
The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.
In order to avoid documents getting too large, the maximum allowed value is 128.
+ ///
+ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) + { + MaxMatchesValue = maxMatches; + return Self; + } + + /// + /// If processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ public EnrichProcessorDescriptor Override(bool? overrideValue = true) + { + OverrideValue = overrideValue; + return Self; + } + + /// + /// The name of the enrich policy to use. + /// + public EnrichProcessorDescriptor PolicyName(string policyName) + { + PolicyNameValue = policyName; + return Self; + } + + /// + /// A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
This option is only used for `geo_match` enrich policy types.
+ ///
+ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? shapeRelation) + { + ShapeRelationValue = shapeRelation; + return Self; + } + + public EnrichProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.
Supports template snippets.
+ ///
+ public EnrichProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (MaxMatchesValue.HasValue) + { + writer.WritePropertyName("max_matches"); + writer.WriteNumberValue(MaxMatchesValue.Value); + } + + if (OverrideValue.HasValue) + { + writer.WritePropertyName("override"); + writer.WriteBooleanValue(OverrideValue.Value); + } + + writer.WritePropertyName("policy_name"); + writer.WriteStringValue(PolicyNameValue); + if (ShapeRelationValue is not null) + { + writer.WritePropertyName("shape_relation"); + JsonSerializer.Serialize(writer, ShapeRelationValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs new file mode 100644 index 00000000000..e63b793f016 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs @@ -0,0 +1,352 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class FailProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// The error message thrown by the processor.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("message")] + public string Message { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(FailProcessor failProcessor) => Ingest.Processor.Fail(failProcessor); +} + +public sealed partial class FailProcessorDescriptor : SerializableDescriptor> +{ + internal FailProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public FailProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string MessageValue { get; set; } + private string? TagValue { get; set; } + + public FailProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FailProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FailProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FailProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public FailProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public FailProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The error message thrown by the processor.
Supports template snippets.
+ ///
+ public FailProcessorDescriptor Message(string message) + { + MessageValue = message; + return Self; + } + + public FailProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("message"); + writer.WriteStringValue(MessageValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FailProcessorDescriptor : SerializableDescriptor +{ + internal FailProcessorDescriptor(Action configure) => configure.Invoke(this); + + public FailProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string MessageValue { get; set; } + private string? TagValue { get; set; } + + public FailProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FailProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FailProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FailProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public FailProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public FailProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The error message thrown by the processor.
Supports template snippets.
+ ///
+ public FailProcessorDescriptor Message(string message) + { + MessageValue = message; + return Self; + } + + public FailProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("message"); + writer.WriteStringValue(MessageValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs new file mode 100644 index 00000000000..2d932d7be58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs @@ -0,0 +1,515 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class ForeachProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Field containing array or object values. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true`, the processor silently exits without changing the document if the `field` is `null` or missing. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Ingest processor to run on each element. + /// + [JsonInclude, JsonPropertyName("processor")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor Processor { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(ForeachProcessor foreachProcessor) => Ingest.Processor.Foreach(foreachProcessor); +} + +public sealed partial class ForeachProcessorDescriptor : SerializableDescriptor> +{ + internal ForeachProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public ForeachProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor ProcessorValue { get; set; } + private ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action> ProcessorDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + + public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Ingest processor to run on each element. + /// + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor processor) + { + ProcessorDescriptor = null; + ProcessorDescriptorAction = null; + ProcessorValue = processor; + return Self; + } + + public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + { + ProcessorValue = null; + ProcessorDescriptorAction = null; + ProcessorDescriptor = descriptor; + return Self; + } + + public ForeachProcessorDescriptor Processor(Action> configure) + { + ProcessorValue = null; + ProcessorDescriptor = null; + ProcessorDescriptorAction = configure; + return Self; + } + + public ForeachProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ForeachProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true`, the processor silently exits without changing the document if the `field` is `null` or missing. + /// + public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public ForeachProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorDescriptor is not null) + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, ProcessorDescriptor, options); + } + else if (ProcessorDescriptorAction is not null) + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + } + else + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, ProcessorValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ForeachProcessorDescriptor : SerializableDescriptor +{ + internal ForeachProcessorDescriptor(Action configure) => configure.Invoke(this); + + public ForeachProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor ProcessorValue { get; set; } + private ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action ProcessorDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + + public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ForeachProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Ingest processor to run on each element. + /// + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor processor) + { + ProcessorDescriptor = null; + ProcessorDescriptorAction = null; + ProcessorValue = processor; + return Self; + } + + public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + { + ProcessorValue = null; + ProcessorDescriptorAction = null; + ProcessorDescriptor = descriptor; + return Self; + } + + public ForeachProcessorDescriptor Processor(Action configure) + { + ProcessorValue = null; + ProcessorDescriptor = null; + ProcessorDescriptorAction = configure; + return Self; + } + + public ForeachProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public ForeachProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true`, the processor silently exits without changing the document if the `field` is `null` or missing. + /// + public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public ForeachProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorDescriptor is not null) + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, ProcessorDescriptor, options); + } + else if (ProcessorDescriptorAction is not null) + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + } + else + { + writer.WritePropertyName("processor"); + JsonSerializer.Serialize(writer, ProcessorValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs new file mode 100644 index 00000000000..7eab61c56a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs @@ -0,0 +1,61 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GeoIpDownloadStatistics +{ + /// + /// Current number of databases available for use. + /// + [JsonInclude, JsonPropertyName("database_count")] + public int DatabaseCount { get; init; } + + /// + /// Total number of failed database downloads. + /// + [JsonInclude, JsonPropertyName("failed_downloads")] + public int FailedDownloads { get; init; } + + /// + /// Total number of database updates skipped. + /// + [JsonInclude, JsonPropertyName("skipped_updates")] + public int SkippedUpdates { get; init; } + + /// + /// Total number of successful database downloads. + /// + [JsonInclude, JsonPropertyName("successful_downloads")] + public int SuccessfulDownloads { get; init; } + + /// + /// Total milliseconds spent downloading databases. + /// + [JsonInclude, JsonPropertyName("total_download_time")] + public long TotalDownloadTime { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs new file mode 100644 index 00000000000..c79c158eb40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GeoIpNodeDatabaseName +{ + /// + /// Name of the database. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs new file mode 100644 index 00000000000..187be6ce93a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +/// +/// Downloaded databases for the node. The field key is the node ID. +/// +public sealed partial class GeoIpNodeDatabases +{ + /// + /// Downloaded databases for the node. + /// + [JsonInclude, JsonPropertyName("databases")] + public IReadOnlyCollection Databases { get; init; } + + /// + /// Downloaded database files, including related license files. Elasticsearch stores these files in the node’s temporary directory: $ES_TMPDIR/geoip-databases/. + /// + [JsonInclude, JsonPropertyName("files_in_temp")] + public IReadOnlyCollection FilesInTemp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs new file mode 100644 index 00000000000..34b4636da11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs @@ -0,0 +1,595 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GeoIpProcessor +{ + /// + /// The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory. + /// + [JsonInclude, JsonPropertyName("database_file")] + public string? DatabaseFile { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// If `true`, only the first found geoip data will be returned, even if the field contains an array. + /// + [JsonInclude, JsonPropertyName("first_only")] + public bool? FirstOnly { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Controls what properties are added to the `target_field` based on the geoip lookup. + /// + [JsonInclude, JsonPropertyName("properties")] + public ICollection? Properties { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(GeoIpProcessor geoIpProcessor) => Ingest.Processor.Geoip(geoIpProcessor); +} + +public sealed partial class GeoIpProcessorDescriptor : SerializableDescriptor> +{ + internal GeoIpProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public GeoIpProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DatabaseFileValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? FirstOnlyValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory. + /// + public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) + { + DatabaseFileValue = databaseFile; + return Self; + } + + public GeoIpProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + public GeoIpProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + public GeoIpProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// If `true`, only the first found geoip data will be returned, even if the field contains an array. + /// + public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) + { + FirstOnlyValue = firstOnly; + return Self; + } + + public GeoIpProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Controls what properties are added to the `target_field` based on the geoip lookup. + /// + public GeoIpProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoIpProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + public GeoIpProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + public GeoIpProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DatabaseFileValue)) + { + writer.WritePropertyName("database_file"); + writer.WriteStringValue(DatabaseFileValue); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (FirstOnlyValue.HasValue) + { + writer.WritePropertyName("first_only"); + writer.WriteBooleanValue(FirstOnlyValue.Value); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoIpProcessorDescriptor : SerializableDescriptor +{ + internal GeoIpProcessorDescriptor(Action configure) => configure.Invoke(this); + + public GeoIpProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DatabaseFileValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private bool? FirstOnlyValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GeoIpProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory. + /// + public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) + { + DatabaseFileValue = databaseFile; + return Self; + } + + public GeoIpProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + public GeoIpProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + public GeoIpProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to get the ip address from for the geographical lookup. + /// + public GeoIpProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// If `true`, only the first found geoip data will be returned, even if the field contains an array. + /// + public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) + { + FirstOnlyValue = firstOnly; + return Self; + } + + public GeoIpProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Controls what properties are added to the `target_field` based on the geoip lookup. + /// + public GeoIpProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoIpProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + public GeoIpProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + public GeoIpProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will hold the geographical information looked up from the MaxMind database. + /// + public GeoIpProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DatabaseFileValue)) + { + writer.WritePropertyName("database_file"); + writer.WriteStringValue(DatabaseFileValue); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (FirstOnlyValue.HasValue) + { + writer.WritePropertyName("first_only"); + writer.WriteBooleanValue(FirstOnlyValue.Value); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs new file mode 100644 index 00000000000..fb93f42aeae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -0,0 +1,523 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GrokProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to use for grok expression parsing. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.
Patterns matching existing names will override the pre-existing definition.
+ ///
+ [JsonInclude, JsonPropertyName("pattern_definitions")] + public IDictionary? PatternDefinitions { get; set; } + + /// + /// An ordered list of grok expression to match and extract named captures with.
Returns on the first expression in the list that matches.
+ ///
+ [JsonInclude, JsonPropertyName("patterns")] + public ICollection Patterns { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched. + /// + [JsonInclude, JsonPropertyName("trace_match")] + public bool? TraceMatch { get; set; } + + public static implicit operator Processor(GrokProcessor grokProcessor) => Ingest.Processor.Grok(grokProcessor); +} + +public sealed partial class GrokProcessorDescriptor : SerializableDescriptor> +{ + internal GrokProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public GrokProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private IDictionary? PatternDefinitionsValue { get; set; } + private ICollection PatternsValue { get; set; } + private string? TagValue { get; set; } + private bool? TraceMatchValue { get; set; } + + public GrokProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GrokProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GrokProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GrokProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public GrokProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GrokProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.
Patterns matching existing names will override the pre-existing definition.
+ ///
+ public GrokProcessorDescriptor PatternDefinitions(Func, FluentDictionary> selector) + { + PatternDefinitionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// An ordered list of grok expression to match and extract named captures with.
Returns on the first expression in the list that matches.
+ ///
+ public GrokProcessorDescriptor Patterns(ICollection patterns) + { + PatternsValue = patterns; + return Self; + } + + public GrokProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched. + /// + public GrokProcessorDescriptor TraceMatch(bool? traceMatch = true) + { + TraceMatchValue = traceMatch; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PatternDefinitionsValue is not null) + { + writer.WritePropertyName("pattern_definitions"); + JsonSerializer.Serialize(writer, PatternDefinitionsValue, options); + } + + writer.WritePropertyName("patterns"); + JsonSerializer.Serialize(writer, PatternsValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TraceMatchValue.HasValue) + { + writer.WritePropertyName("trace_match"); + writer.WriteBooleanValue(TraceMatchValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GrokProcessorDescriptor : SerializableDescriptor +{ + internal GrokProcessorDescriptor(Action configure) => configure.Invoke(this); + + public GrokProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private IDictionary? PatternDefinitionsValue { get; set; } + private ICollection PatternsValue { get; set; } + private string? TagValue { get; set; } + private bool? TraceMatchValue { get; set; } + + public GrokProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GrokProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GrokProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GrokProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public GrokProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GrokProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.
Patterns matching existing names will override the pre-existing definition.
+ ///
+ public GrokProcessorDescriptor PatternDefinitions(Func, FluentDictionary> selector) + { + PatternDefinitionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// An ordered list of grok expression to match and extract named captures with.
Returns on the first expression in the list that matches.
+ ///
+ public GrokProcessorDescriptor Patterns(ICollection patterns) + { + PatternsValue = patterns; + return Self; + } + + public GrokProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched. + /// + public GrokProcessorDescriptor TraceMatch(bool? traceMatch = true) + { + TraceMatchValue = traceMatch; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PatternDefinitionsValue is not null) + { + writer.WritePropertyName("pattern_definitions"); + JsonSerializer.Serialize(writer, PatternDefinitionsValue, options); + } + + writer.WritePropertyName("patterns"); + JsonSerializer.Serialize(writer, PatternsValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TraceMatchValue.HasValue) + { + writer.WritePropertyName("trace_match"); + writer.WriteBooleanValue(TraceMatchValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs new file mode 100644 index 00000000000..e3aa0bb2dd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs @@ -0,0 +1,542 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class GsubProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to apply the replacement to. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// The pattern to be replaced. + /// + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + + /// + /// The string to replace the matching patterns with. + /// + [JsonInclude, JsonPropertyName("replacement")] + public string Replacement { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(GsubProcessor gsubProcessor) => Ingest.Processor.Gsub(gsubProcessor); +} + +public sealed partial class GsubProcessorDescriptor : SerializableDescriptor> +{ + internal GsubProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public GsubProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string PatternValue { get; set; } + private string ReplacementValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public GsubProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GsubProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GsubProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GsubProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public GsubProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GsubProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The pattern to be replaced. + /// + public GsubProcessorDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + /// + /// The string to replace the matching patterns with. + /// + public GsubProcessorDescriptor Replacement(string replacement) + { + ReplacementValue = replacement; + return Self; + } + + public GsubProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ public GsubProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ public GsubProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + writer.WritePropertyName("replacement"); + writer.WriteStringValue(ReplacementValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GsubProcessorDescriptor : SerializableDescriptor +{ + internal GsubProcessorDescriptor(Action configure) => configure.Invoke(this); + + public GsubProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string PatternValue { get; set; } + private string ReplacementValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public GsubProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public GsubProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public GsubProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public GsubProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public GsubProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GsubProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// The pattern to be replaced. + /// + public GsubProcessorDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + /// + /// The string to replace the matching patterns with. + /// + public GsubProcessorDescriptor Replacement(string replacement) + { + ReplacementValue = replacement; + return Self; + } + + public GsubProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ public GsubProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ public GsubProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to
By default, the `field` is updated in-place.
+ ///
+ public GsubProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + writer.WritePropertyName("replacement"); + writer.WriteStringValue(ReplacementValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs new file mode 100644 index 00000000000..429410e7871 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs @@ -0,0 +1,223 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +[JsonConverter(typeof(InferenceConfigConverter))] +public sealed partial class InferenceConfig +{ + internal InferenceConfig(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigClassification inferenceConfigClassification) => new InferenceConfig("classification", inferenceConfigClassification); + public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigRegression inferenceConfigRegression) => new InferenceConfig("regression", inferenceConfigRegression); +} + +internal sealed partial class InferenceConfigConverter : JsonConverter +{ + public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfig(propertyName, variant); + } + + if (propertyName == "regression") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfig(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigClassification)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigRegression)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigDescriptor : SerializableDescriptor> +{ + internal InferenceConfigDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigDescriptor Classification(InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action> configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(InferenceConfigRegression inferenceConfigRegression) => Set(inferenceConfigRegression, "regression"); + public InferenceConfigDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigDescriptor : SerializableDescriptor +{ + internal InferenceConfigDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigDescriptor Classification(InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Classification(Action> configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(InferenceConfigRegression inferenceConfigRegression) => Set(inferenceConfigRegression, "regression"); + public InferenceConfigDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs new file mode 100644 index 00000000000..d7238fa52fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs @@ -0,0 +1,309 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class InferenceConfigClassification +{ + /// + /// Specifies the number of top class predictions to return. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + [JsonInclude, JsonPropertyName("num_top_feature_importance_values")] + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Specifies the type of the predicted field to write.
Valid values are: `string`, `number`, `boolean`.
+ ///
+ [JsonInclude, JsonPropertyName("prediction_field_type")] + public string? PredictionFieldType { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + [JsonInclude, JsonPropertyName("results_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? ResultsField { get; set; } + + /// + /// Specifies the field to which the top classes are written. + /// + [JsonInclude, JsonPropertyName("top_classes_results_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesResultsField { get; set; } + + public static implicit operator InferenceConfig(InferenceConfigClassification inferenceConfigClassification) => Ingest.InferenceConfig.Classification(inferenceConfigClassification); +} + +public sealed partial class InferenceConfigClassificationDescriptor : SerializableDescriptor> +{ + internal InferenceConfigClassificationDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigClassificationDescriptor() : base() + { + } + + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private string? PredictionFieldTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesResultsFieldValue { get; set; } + + /// + /// Specifies the number of top class predictions to return. + /// + public InferenceConfigClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public InferenceConfigClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Specifies the type of the predicted field to write.
Valid values are: `string`, `number`, `boolean`.
+ ///
+ public InferenceConfigClassificationDescriptor PredictionFieldType(string? predictionFieldType) + { + PredictionFieldTypeValue = predictionFieldType; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigClassificationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigClassificationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. + /// + public InferenceConfigClassificationDescriptor TopClassesResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. + /// + public InferenceConfigClassificationDescriptor TopClassesResultsField(Expression> topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (!string.IsNullOrEmpty(PredictionFieldTypeValue)) + { + writer.WritePropertyName("prediction_field_type"); + writer.WriteStringValue(PredictionFieldTypeValue); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + if (TopClassesResultsFieldValue is not null) + { + writer.WritePropertyName("top_classes_results_field"); + JsonSerializer.Serialize(writer, TopClassesResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigClassificationDescriptor : SerializableDescriptor +{ + internal InferenceConfigClassificationDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigClassificationDescriptor() : base() + { + } + + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private string? PredictionFieldTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesResultsFieldValue { get; set; } + + /// + /// Specifies the number of top class predictions to return. + /// + public InferenceConfigClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public InferenceConfigClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Specifies the type of the predicted field to write.
Valid values are: `string`, `number`, `boolean`.
+ ///
+ public InferenceConfigClassificationDescriptor PredictionFieldType(string? predictionFieldType) + { + PredictionFieldTypeValue = predictionFieldType; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigClassificationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigClassificationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigClassificationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. + /// + public InferenceConfigClassificationDescriptor TopClassesResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. + /// + public InferenceConfigClassificationDescriptor TopClassesResultsField(Expression> topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. + /// + public InferenceConfigClassificationDescriptor TopClassesResultsField(Expression> topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (!string.IsNullOrEmpty(PredictionFieldTypeValue)) + { + writer.WritePropertyName("prediction_field_type"); + writer.WriteStringValue(PredictionFieldTypeValue); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + if (TopClassesResultsFieldValue is not null) + { + writer.WritePropertyName("top_classes_results_field"); + JsonSerializer.Serialize(writer, TopClassesResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs new file mode 100644 index 00000000000..5cb21f41210 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs @@ -0,0 +1,168 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class InferenceConfigRegression +{ + /// + /// Specifies the maximum number of feature importance values per document. + /// + [JsonInclude, JsonPropertyName("num_top_feature_importance_values")] + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + [JsonInclude, JsonPropertyName("results_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? ResultsField { get; set; } + + public static implicit operator InferenceConfig(InferenceConfigRegression inferenceConfigRegression) => Ingest.InferenceConfig.Regression(inferenceConfigRegression); +} + +public sealed partial class InferenceConfigRegressionDescriptor : SerializableDescriptor> +{ + internal InferenceConfigRegressionDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigRegressionDescriptor() : base() + { + } + + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public InferenceConfigRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigRegressionDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigRegressionDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigRegressionDescriptor : SerializableDescriptor +{ + internal InferenceConfigRegressionDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigRegressionDescriptor() : base() + { + } + + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public InferenceConfigRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigRegressionDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigRegressionDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. + /// + public InferenceConfigRegressionDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs new file mode 100644 index 00000000000..0c20284ebc0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs @@ -0,0 +1,553 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class InferenceProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Maps the document field names to the known field names of the model.
This mapping takes precedence over any default mappings provided in the model configuration.
+ ///
+ [JsonInclude, JsonPropertyName("field_map")] + public IDictionary? FieldMap { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// Contains the inference type and its options. + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? InferenceConfig { get; set; } + + /// + /// The ID or alias for the trained model, or the ID of the deployment. + /// + [JsonInclude, JsonPropertyName("model_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id ModelId { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// Field added to incoming documents to contain results objects. + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(InferenceProcessor inferenceProcessor) => Ingest.Processor.Inference(inferenceProcessor); +} + +public sealed partial class InferenceProcessorDescriptor : SerializableDescriptor> +{ + internal InferenceProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceProcessorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? InferenceConfigValue { get; set; } + private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private IDictionary? FieldMapValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id ModelIdValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// Contains the inference type and its options. + /// + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferenceProcessorDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public InferenceProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Maps the document field names to the known field names of the model.
This mapping takes precedence over any default mappings provided in the model configuration.
+ ///
+ public InferenceProcessorDescriptor FieldMap(Func, FluentDictionary> selector) + { + FieldMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public InferenceProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The ID or alias for the trained model, or the ID of the deployment. + /// + public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + ModelIdValue = modelId; + return Self; + } + + public InferenceProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// Field added to incoming documents to contain results objects. + /// + public InferenceProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain results objects. + /// + public InferenceProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InferenceConfigDescriptor is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigDescriptor, options); + } + else if (InferenceConfigDescriptorAction is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (FieldMapValue is not null) + { + writer.WritePropertyName("field_map"); + JsonSerializer.Serialize(writer, FieldMapValue, options); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceProcessorDescriptor : SerializableDescriptor +{ + internal InferenceProcessorDescriptor(Action configure) => configure.Invoke(this); + + public InferenceProcessorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? InferenceConfigValue { get; set; } + private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private IDictionary? FieldMapValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id ModelIdValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// Contains the inference type and its options. + /// + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferenceProcessorDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public InferenceProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public InferenceProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Maps the document field names to the known field names of the model.
This mapping takes precedence over any default mappings provided in the model configuration.
+ ///
+ public InferenceProcessorDescriptor FieldMap(Func, FluentDictionary> selector) + { + FieldMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public InferenceProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The ID or alias for the trained model, or the ID of the deployment. + /// + public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + ModelIdValue = modelId; + return Self; + } + + public InferenceProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// Field added to incoming documents to contain results objects. + /// + public InferenceProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain results objects. + /// + public InferenceProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// Field added to incoming documents to contain results objects. + /// + public InferenceProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InferenceConfigDescriptor is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigDescriptor, options); + } + else if (InferenceConfigDescriptorAction is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (FieldMapValue is not null) + { + writer.WritePropertyName("field_map"); + JsonSerializer.Serialize(writer, FieldMapValue, options); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs new file mode 100644 index 00000000000..781268c19f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class IngestInfo +{ + [JsonInclude, JsonPropertyName("pipeline")] + public string? Pipeline { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public DateTimeOffset Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs new file mode 100644 index 00000000000..412aebd93c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs @@ -0,0 +1,474 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class JoinProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Field containing array values to join. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// The separator character. + /// + [JsonInclude, JsonPropertyName("separator")] + public string Separator { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(JoinProcessor joinProcessor) => Ingest.Processor.Join(joinProcessor); +} + +public sealed partial class JoinProcessorDescriptor : SerializableDescriptor> +{ + internal JoinProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public JoinProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public JoinProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public JoinProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public JoinProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public JoinProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public JoinProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public JoinProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The separator character. + /// + public JoinProcessorDescriptor Separator(string separator) + { + SeparatorValue = separator; + return Self; + } + + public JoinProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ public JoinProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ public JoinProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class JoinProcessorDescriptor : SerializableDescriptor +{ + internal JoinProcessorDescriptor(Action configure) => configure.Invoke(this); + + public JoinProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public JoinProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public JoinProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public JoinProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public JoinProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public JoinProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public JoinProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The separator character. + /// + public JoinProcessorDescriptor Separator(string separator) + { + SeparatorValue = separator; + return Self; + } + + public JoinProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ public JoinProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ public JoinProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the joined value to.
By default, the field is updated in-place.
+ ///
+ public JoinProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs new file mode 100644 index 00000000000..901b2a311d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs @@ -0,0 +1,557 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class JsonProcessor +{ + /// + /// Flag that forces the parsed JSON to be added at the top level of the document.
`target_field` must not be set when this option is chosen.
+ ///
+ [JsonInclude, JsonPropertyName("add_to_root")] + public bool? AddToRoot { get; set; } + + /// + /// When set to `replace`, root fields that conflict with fields from the parsed JSON will be overridden.
When set to `merge`, conflicting fields will be merged.
Only applicable `if add_to_root` is set to true.
+ ///
+ [JsonInclude, JsonPropertyName("add_to_root_conflict_strategy")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessorConflictStrategy? AddToRootConflictStrategy { get; set; } + + /// + /// When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.
Instead, the last encountered value for any duplicate key wins.
+ ///
+ [JsonInclude, JsonPropertyName("allow_duplicate_keys")] + public bool? AllowDuplicateKeys { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to be parsed. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(JsonProcessor jsonProcessor) => Ingest.Processor.Json(jsonProcessor); +} + +public sealed partial class JsonProcessorDescriptor : SerializableDescriptor> +{ + internal JsonProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public JsonProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private bool? AddToRootValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessorConflictStrategy? AddToRootConflictStrategyValue { get; set; } + private bool? AllowDuplicateKeysValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public JsonProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public JsonProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public JsonProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public JsonProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Flag that forces the parsed JSON to be added at the top level of the document.
`target_field` must not be set when this option is chosen.
+ ///
+ public JsonProcessorDescriptor AddToRoot(bool? addToRoot = true) + { + AddToRootValue = addToRoot; + return Self; + } + + /// + /// When set to `replace`, root fields that conflict with fields from the parsed JSON will be overridden.
When set to `merge`, conflicting fields will be merged.
Only applicable `if add_to_root` is set to true.
+ ///
+ public JsonProcessorDescriptor AddToRootConflictStrategy(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessorConflictStrategy? addToRootConflictStrategy) + { + AddToRootConflictStrategyValue = addToRootConflictStrategy; + return Self; + } + + /// + /// When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.
Instead, the last encountered value for any duplicate key wins.
+ ///
+ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicateKeys = true) + { + AllowDuplicateKeysValue = allowDuplicateKeys; + return Self; + } + + public JsonProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public JsonProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public JsonProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ public JsonProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ public JsonProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (AddToRootValue.HasValue) + { + writer.WritePropertyName("add_to_root"); + writer.WriteBooleanValue(AddToRootValue.Value); + } + + if (AddToRootConflictStrategyValue is not null) + { + writer.WritePropertyName("add_to_root_conflict_strategy"); + JsonSerializer.Serialize(writer, AddToRootConflictStrategyValue, options); + } + + if (AllowDuplicateKeysValue.HasValue) + { + writer.WritePropertyName("allow_duplicate_keys"); + writer.WriteBooleanValue(AllowDuplicateKeysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class JsonProcessorDescriptor : SerializableDescriptor +{ + internal JsonProcessorDescriptor(Action configure) => configure.Invoke(this); + + public JsonProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private bool? AddToRootValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessorConflictStrategy? AddToRootConflictStrategyValue { get; set; } + private bool? AllowDuplicateKeysValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public JsonProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public JsonProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public JsonProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public JsonProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Flag that forces the parsed JSON to be added at the top level of the document.
`target_field` must not be set when this option is chosen.
+ ///
+ public JsonProcessorDescriptor AddToRoot(bool? addToRoot = true) + { + AddToRootValue = addToRoot; + return Self; + } + + /// + /// When set to `replace`, root fields that conflict with fields from the parsed JSON will be overridden.
When set to `merge`, conflicting fields will be merged.
Only applicable `if add_to_root` is set to true.
+ ///
+ public JsonProcessorDescriptor AddToRootConflictStrategy(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessorConflictStrategy? addToRootConflictStrategy) + { + AddToRootConflictStrategyValue = addToRootConflictStrategy; + return Self; + } + + /// + /// When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.
Instead, the last encountered value for any duplicate key wins.
+ ///
+ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicateKeys = true) + { + AllowDuplicateKeysValue = allowDuplicateKeys; + return Self; + } + + public JsonProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public JsonProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public JsonProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ public JsonProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ public JsonProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that the converted structured object will be written into.
Any existing content in this field will be overwritten.
+ ///
+ public JsonProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (AddToRootValue.HasValue) + { + writer.WritePropertyName("add_to_root"); + writer.WriteBooleanValue(AddToRootValue.Value); + } + + if (AddToRootConflictStrategyValue is not null) + { + writer.WritePropertyName("add_to_root_conflict_strategy"); + JsonSerializer.Serialize(writer, AddToRootConflictStrategyValue, options); + } + + if (AllowDuplicateKeysValue.HasValue) + { + writer.WritePropertyName("allow_duplicate_keys"); + writer.WriteBooleanValue(AllowDuplicateKeysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs new file mode 100644 index 00000000000..b5dc0898a1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs @@ -0,0 +1,770 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class KeyValueProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// List of keys to exclude from document. + /// + [JsonInclude, JsonPropertyName("exclude_keys")] + public ICollection? ExcludeKeys { get; set; } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Regex pattern to use for splitting key-value pairs. + /// + [JsonInclude, JsonPropertyName("field_split")] + public string FieldSplit { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// List of keys to filter and insert into document.
Defaults to including all keys.
+ ///
+ [JsonInclude, JsonPropertyName("include_keys")] + public ICollection? IncludeKeys { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Prefix to be added to extracted keys. + /// + [JsonInclude, JsonPropertyName("prefix")] + public string? Prefix { get; set; } + + /// + /// If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `'` and `"` from extracted values. + /// + [JsonInclude, JsonPropertyName("strip_brackets")] + public bool? StripBrackets { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + /// + /// String of characters to trim from extracted keys. + /// + [JsonInclude, JsonPropertyName("trim_key")] + public string? TrimKey { get; set; } + + /// + /// String of characters to trim from extracted values. + /// + [JsonInclude, JsonPropertyName("trim_value")] + public string? TrimValue { get; set; } + + /// + /// Regex pattern to use for splitting the key from the value within a key-value pair. + /// + [JsonInclude, JsonPropertyName("value_split")] + public string ValueSplit { get; set; } + + public static implicit operator Processor(KeyValueProcessor keyValueProcessor) => Ingest.Processor.Kv(keyValueProcessor); +} + +public sealed partial class KeyValueProcessorDescriptor : SerializableDescriptor> +{ + internal KeyValueProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public KeyValueProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? ExcludeKeysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string FieldSplitValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? IncludeKeysValue { get; set; } + private string? PrefixValue { get; set; } + private bool? StripBracketsValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private string? TrimKeyValue { get; set; } + private string? TrimValueValue { get; set; } + private string ValueSplitValue { get; set; } + + public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public KeyValueProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// List of keys to exclude from document. + /// + public KeyValueProcessorDescriptor ExcludeKeys(ICollection? excludeKeys) + { + ExcludeKeysValue = excludeKeys; + return Self; + } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Regex pattern to use for splitting key-value pairs. + /// + public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) + { + FieldSplitValue = fieldSplit; + return Self; + } + + public KeyValueProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public KeyValueProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// List of keys to filter and insert into document.
Defaults to including all keys.
+ ///
+ public KeyValueProcessorDescriptor IncludeKeys(ICollection? includeKeys) + { + IncludeKeysValue = includeKeys; + return Self; + } + + /// + /// Prefix to be added to extracted keys. + /// + public KeyValueProcessorDescriptor Prefix(string? prefix) + { + PrefixValue = prefix; + return Self; + } + + /// + /// If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `'` and `"` from extracted values. + /// + public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets = true) + { + StripBracketsValue = stripBrackets; + return Self; + } + + public KeyValueProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// String of characters to trim from extracted keys. + /// + public KeyValueProcessorDescriptor TrimKey(string? trimKey) + { + TrimKeyValue = trimKey; + return Self; + } + + /// + /// String of characters to trim from extracted values. + /// + public KeyValueProcessorDescriptor TrimValue(string? trimValue) + { + TrimValueValue = trimValue; + return Self; + } + + /// + /// Regex pattern to use for splitting the key from the value within a key-value pair. + /// + public KeyValueProcessorDescriptor ValueSplit(string valueSplit) + { + ValueSplitValue = valueSplit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (ExcludeKeysValue is not null) + { + writer.WritePropertyName("exclude_keys"); + JsonSerializer.Serialize(writer, ExcludeKeysValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("field_split"); + writer.WriteStringValue(FieldSplitValue); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (IncludeKeysValue is not null) + { + writer.WritePropertyName("include_keys"); + JsonSerializer.Serialize(writer, IncludeKeysValue, options); + } + + if (!string.IsNullOrEmpty(PrefixValue)) + { + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + } + + if (StripBracketsValue.HasValue) + { + writer.WritePropertyName("strip_brackets"); + writer.WriteBooleanValue(StripBracketsValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (!string.IsNullOrEmpty(TrimKeyValue)) + { + writer.WritePropertyName("trim_key"); + writer.WriteStringValue(TrimKeyValue); + } + + if (!string.IsNullOrEmpty(TrimValueValue)) + { + writer.WritePropertyName("trim_value"); + writer.WriteStringValue(TrimValueValue); + } + + writer.WritePropertyName("value_split"); + writer.WriteStringValue(ValueSplitValue); + writer.WriteEndObject(); + } +} + +public sealed partial class KeyValueProcessorDescriptor : SerializableDescriptor +{ + internal KeyValueProcessorDescriptor(Action configure) => configure.Invoke(this); + + public KeyValueProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? ExcludeKeysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string FieldSplitValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? IncludeKeysValue { get; set; } + private string? PrefixValue { get; set; } + private bool? StripBracketsValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private string? TrimKeyValue { get; set; } + private string? TrimValueValue { get; set; } + private string ValueSplitValue { get; set; } + + public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public KeyValueProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public KeyValueProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// List of keys to exclude from document. + /// + public KeyValueProcessorDescriptor ExcludeKeys(ICollection? excludeKeys) + { + ExcludeKeysValue = excludeKeys; + return Self; + } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be parsed.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Regex pattern to use for splitting key-value pairs. + /// + public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) + { + FieldSplitValue = fieldSplit; + return Self; + } + + public KeyValueProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public KeyValueProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// List of keys to filter and insert into document.
Defaults to including all keys.
+ ///
+ public KeyValueProcessorDescriptor IncludeKeys(ICollection? includeKeys) + { + IncludeKeysValue = includeKeys; + return Self; + } + + /// + /// Prefix to be added to extracted keys. + /// + public KeyValueProcessorDescriptor Prefix(string? prefix) + { + PrefixValue = prefix; + return Self; + } + + /// + /// If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `'` and `"` from extracted values. + /// + public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets = true) + { + StripBracketsValue = stripBrackets; + return Self; + } + + public KeyValueProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to insert the extracted keys into.
Defaults to the root of the document.
Supports template snippets.
+ ///
+ public KeyValueProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// String of characters to trim from extracted keys. + /// + public KeyValueProcessorDescriptor TrimKey(string? trimKey) + { + TrimKeyValue = trimKey; + return Self; + } + + /// + /// String of characters to trim from extracted values. + /// + public KeyValueProcessorDescriptor TrimValue(string? trimValue) + { + TrimValueValue = trimValue; + return Self; + } + + /// + /// Regex pattern to use for splitting the key from the value within a key-value pair. + /// + public KeyValueProcessorDescriptor ValueSplit(string valueSplit) + { + ValueSplitValue = valueSplit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (ExcludeKeysValue is not null) + { + writer.WritePropertyName("exclude_keys"); + JsonSerializer.Serialize(writer, ExcludeKeysValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("field_split"); + writer.WriteStringValue(FieldSplitValue); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (IncludeKeysValue is not null) + { + writer.WritePropertyName("include_keys"); + JsonSerializer.Serialize(writer, IncludeKeysValue, options); + } + + if (!string.IsNullOrEmpty(PrefixValue)) + { + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + } + + if (StripBracketsValue.HasValue) + { + writer.WritePropertyName("strip_brackets"); + writer.WriteBooleanValue(StripBracketsValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (!string.IsNullOrEmpty(TrimKeyValue)) + { + writer.WritePropertyName("trim_key"); + writer.WriteStringValue(TrimKeyValue); + } + + if (!string.IsNullOrEmpty(TrimValueValue)) + { + writer.WritePropertyName("trim_value"); + writer.WriteStringValue(TrimValueValue); + } + + writer.WritePropertyName("value_split"); + writer.WriteStringValue(ValueSplitValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs new file mode 100644 index 00000000000..57864149d50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class LowercaseProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to make lowercase. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(LowercaseProcessor lowercaseProcessor) => Ingest.Processor.Lowercase(lowercaseProcessor); +} + +public sealed partial class LowercaseProcessorDescriptor : SerializableDescriptor> +{ + internal LowercaseProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public LowercaseProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public LowercaseProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public LowercaseProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public LowercaseProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public LowercaseProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public LowercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class LowercaseProcessorDescriptor : SerializableDescriptor +{ + internal LowercaseProcessorDescriptor(Action configure) => configure.Invoke(this); + + public LowercaseProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public LowercaseProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public LowercaseProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public LowercaseProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public LowercaseProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public LowercaseProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public LowercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public LowercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs new file mode 100644 index 00000000000..fafa1e1851f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs @@ -0,0 +1,447 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class Pipeline +{ + /// + /// Description of the ingest pipeline. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Processors to run immediately after a processor failure. + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Processors used to perform transformations on documents before indexing.
Processors run sequentially in the order specified.
+ ///
+ [JsonInclude, JsonPropertyName("processors")] + public ICollection? Processors { get; set; } + + /// + /// Version number used by external systems to track ingest pipelines. + /// + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } +} + +public sealed partial class PipelineDescriptor : SerializableDescriptor> +{ + internal PipelineDescriptor(Action> configure) => configure.Invoke(this); + + public PipelineDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private ICollection? ProcessorsValue { get; set; } + private ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Processors to run immediately after a processor failure. + /// + public PipelineDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PipelineDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PipelineDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PipelineDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Processors used to perform transformations on documents before indexing.
Processors run sequentially in the order specified.
+ ///
+ public PipelineDescriptor Processors(ICollection? processors) + { + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsValue = processors; + return Self; + } + + public PipelineDescriptor Processors(ProcessorDescriptor descriptor) + { + ProcessorsValue = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptor = descriptor; + return Self; + } + + public PipelineDescriptor Processors(Action> configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptorAction = configure; + return Self; + } + + public PipelineDescriptor Processors(params Action>[] configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Description of the ingest pipeline. + /// + public PipelineDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Version number used by external systems to track ingest pipelines. + /// + public PipelineDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorsDescriptor is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + foreach (var action in ProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ProcessorsValue is not null) + { + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PipelineDescriptor : SerializableDescriptor +{ + internal PipelineDescriptor(Action configure) => configure.Invoke(this); + + public PipelineDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private ICollection? ProcessorsValue { get; set; } + private ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private long? VersionValue { get; set; } + + /// + /// Processors to run immediately after a processor failure. + /// + public PipelineDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PipelineDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PipelineDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PipelineDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Processors used to perform transformations on documents before indexing.
Processors run sequentially in the order specified.
+ ///
+ public PipelineDescriptor Processors(ICollection? processors) + { + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsValue = processors; + return Self; + } + + public PipelineDescriptor Processors(ProcessorDescriptor descriptor) + { + ProcessorsValue = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptor = descriptor; + return Self; + } + + public PipelineDescriptor Processors(Action configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorActions = null; + ProcessorsDescriptorAction = configure; + return Self; + } + + public PipelineDescriptor Processors(params Action[] configure) + { + ProcessorsValue = null; + ProcessorsDescriptor = null; + ProcessorsDescriptorAction = null; + ProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Description of the ingest pipeline. + /// + public PipelineDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Version number used by external systems to track ingest pipelines. + /// + public PipelineDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ProcessorsDescriptor is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("processors"); + writer.WriteStartArray(); + foreach (var action in ProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ProcessorsValue is not null) + { + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs new file mode 100644 index 00000000000..1bfb1a1d643 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs @@ -0,0 +1,390 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class PipelineProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// Whether to ignore missing pipelines instead of failing. + /// + [JsonInclude, JsonPropertyName("ignore_missing_pipeline")] + public bool? IgnoreMissingPipeline { get; set; } + + /// + /// The name of the pipeline to execute.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name Name { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(PipelineProcessor pipelineProcessor) => Ingest.Processor.Pipeline(pipelineProcessor); +} + +public sealed partial class PipelineProcessorDescriptor : SerializableDescriptor> +{ + internal PipelineProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public PipelineProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingPipelineValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + private string? TagValue { get; set; } + + public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public PipelineProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public PipelineProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Whether to ignore missing pipelines instead of failing. + /// + public PipelineProcessorDescriptor IgnoreMissingPipeline(bool? ignoreMissingPipeline = true) + { + IgnoreMissingPipelineValue = ignoreMissingPipeline; + return Self; + } + + /// + /// The name of the pipeline to execute.
Supports template snippets.
+ ///
+ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + public PipelineProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingPipelineValue.HasValue) + { + writer.WritePropertyName("ignore_missing_pipeline"); + writer.WriteBooleanValue(IgnoreMissingPipelineValue.Value); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PipelineProcessorDescriptor : SerializableDescriptor +{ + internal PipelineProcessorDescriptor(Action configure) => configure.Invoke(this); + + public PipelineProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingPipelineValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + private string? TagValue { get; set; } + + public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public PipelineProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public PipelineProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public PipelineProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Whether to ignore missing pipelines instead of failing. + /// + public PipelineProcessorDescriptor IgnoreMissingPipeline(bool? ignoreMissingPipeline = true) + { + IgnoreMissingPipelineValue = ignoreMissingPipeline; + return Self; + } + + /// + /// The name of the pipeline to execute.
Supports template snippets.
+ ///
+ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + public PipelineProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingPipelineValue.HasValue) + { + writer.WritePropertyName("ignore_missing_pipeline"); + writer.WriteBooleanValue(IgnoreMissingPipelineValue.Value); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs new file mode 100644 index 00000000000..989ce5bf41f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class PipelineSimulation +{ + [JsonInclude, JsonPropertyName("doc")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentSimulation? Doc { get; init; } + [JsonInclude, JsonPropertyName("processor_results")] + public IReadOnlyCollection? ProcessorResults { get; init; } + [JsonInclude, JsonPropertyName("processor_type")] + public string? ProcessorType { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Watcher.ActionStatusOptions? Status { get; init; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs new file mode 100644 index 00000000000..72fb9d37b61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs @@ -0,0 +1,719 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +[JsonConverter(typeof(ProcessorConverter))] +public sealed partial class Processor +{ + internal Processor(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static Processor Append(Elastic.Clients.Elasticsearch.Serverless.Ingest.AppendProcessor appendProcessor) => new Processor("append", appendProcessor); + public static Processor Attachment(Elastic.Clients.Elasticsearch.Serverless.Ingest.AttachmentProcessor attachmentProcessor) => new Processor("attachment", attachmentProcessor); + public static Processor Bytes(Elastic.Clients.Elasticsearch.Serverless.Ingest.BytesProcessor bytesProcessor) => new Processor("bytes", bytesProcessor); + public static Processor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => new Processor("circle", circleProcessor); + public static Processor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => new Processor("convert", convertProcessor); + public static Processor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => new Processor("csv", csvProcessor); + public static Processor Date(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateProcessor dateProcessor) => new Processor("date", dateProcessor); + public static Processor DateIndexName(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateIndexNameProcessor dateIndexNameProcessor) => new Processor("date_index_name", dateIndexNameProcessor); + public static Processor Dissect(Elastic.Clients.Elasticsearch.Serverless.Ingest.DissectProcessor dissectProcessor) => new Processor("dissect", dissectProcessor); + public static Processor DotExpander(Elastic.Clients.Elasticsearch.Serverless.Ingest.DotExpanderProcessor dotExpanderProcessor) => new Processor("dot_expander", dotExpanderProcessor); + public static Processor Drop(Elastic.Clients.Elasticsearch.Serverless.Ingest.DropProcessor dropProcessor) => new Processor("drop", dropProcessor); + public static Processor Enrich(Elastic.Clients.Elasticsearch.Serverless.Ingest.EnrichProcessor enrichProcessor) => new Processor("enrich", enrichProcessor); + public static Processor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => new Processor("fail", failProcessor); + public static Processor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => new Processor("foreach", foreachProcessor); + public static Processor Geoip(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor geoIpProcessor) => new Processor("geoip", geoIpProcessor); + public static Processor Grok(Elastic.Clients.Elasticsearch.Serverless.Ingest.GrokProcessor grokProcessor) => new Processor("grok", grokProcessor); + public static Processor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => new Processor("gsub", gsubProcessor); + public static Processor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => new Processor("inference", inferenceProcessor); + public static Processor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => new Processor("join", joinProcessor); + public static Processor Json(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor jsonProcessor) => new Processor("json", jsonProcessor); + public static Processor Kv(Elastic.Clients.Elasticsearch.Serverless.Ingest.KeyValueProcessor keyValueProcessor) => new Processor("kv", keyValueProcessor); + public static Processor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => new Processor("lowercase", lowercaseProcessor); + public static Processor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => new Processor("pipeline", pipelineProcessor); + public static Processor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => new Processor("remove", removeProcessor); + public static Processor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => new Processor("rename", renameProcessor); + public static Processor Set(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetProcessor setProcessor) => new Processor("set", setProcessor); + public static Processor SetSecurityUser(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => new Processor("set_security_user", setSecurityUserProcessor); + public static Processor Sort(Elastic.Clients.Elasticsearch.Serverless.Ingest.SortProcessor sortProcessor) => new Processor("sort", sortProcessor); + public static Processor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => new Processor("split", splitProcessor); + public static Processor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => new Processor("trim", trimProcessor); + public static Processor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => new Processor("uppercase", uppercaseProcessor); + public static Processor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => new Processor("urldecode", urlDecodeProcessor); + public static Processor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.UserAgentProcessor userAgentProcessor) => new Processor("user_agent", userAgentProcessor); +} + +internal sealed partial class ProcessorConverter : JsonConverter +{ + public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "append") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "attachment") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "bytes") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "circle") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "convert") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "csv") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "date") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "date_index_name") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "dissect") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "dot_expander") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "drop") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "enrich") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "fail") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "foreach") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "geoip") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "grok") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "gsub") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "inference") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "join") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "json") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "kv") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "lowercase") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "pipeline") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "remove") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "rename") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "set") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "set_security_user") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "sort") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "split") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "trim") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "uppercase") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "urldecode") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + if (propertyName == "user_agent") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Processor(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Processor value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "append": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.AppendProcessor)value.Variant, options); + break; + case "attachment": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.AttachmentProcessor)value.Variant, options); + break; + case "bytes": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.BytesProcessor)value.Variant, options); + break; + case "circle": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor)value.Variant, options); + break; + case "convert": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor)value.Variant, options); + break; + case "csv": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor)value.Variant, options); + break; + case "date": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.DateProcessor)value.Variant, options); + break; + case "date_index_name": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.DateIndexNameProcessor)value.Variant, options); + break; + case "dissect": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.DissectProcessor)value.Variant, options); + break; + case "dot_expander": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.DotExpanderProcessor)value.Variant, options); + break; + case "drop": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.DropProcessor)value.Variant, options); + break; + case "enrich": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.EnrichProcessor)value.Variant, options); + break; + case "fail": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor)value.Variant, options); + break; + case "foreach": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor)value.Variant, options); + break; + case "geoip": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor)value.Variant, options); + break; + case "grok": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.GrokProcessor)value.Variant, options); + break; + case "gsub": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor)value.Variant, options); + break; + case "inference": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor)value.Variant, options); + break; + case "join": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor)value.Variant, options); + break; + case "json": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor)value.Variant, options); + break; + case "kv": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.KeyValueProcessor)value.Variant, options); + break; + case "lowercase": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor)value.Variant, options); + break; + case "pipeline": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor)value.Variant, options); + break; + case "remove": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor)value.Variant, options); + break; + case "rename": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor)value.Variant, options); + break; + case "set": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SetProcessor)value.Variant, options); + break; + case "set_security_user": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SetSecurityUserProcessor)value.Variant, options); + break; + case "sort": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SortProcessor)value.Variant, options); + break; + case "split": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor)value.Variant, options); + break; + case "trim": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor)value.Variant, options); + break; + case "uppercase": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor)value.Variant, options); + break; + case "urldecode": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor)value.Variant, options); + break; + case "user_agent": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UserAgentProcessor)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ProcessorDescriptor : SerializableDescriptor> +{ + internal ProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public ProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private ProcessorDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private ProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public ProcessorDescriptor Append(AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action> configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action> configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action> configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action> configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action> configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action> configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action> configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action> configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action> configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action> configure) => Set(configure, "join"); + public ProcessorDescriptor Json(JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action> configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action> configure) => Set(configure, "rename"); + public ProcessorDescriptor Set(SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action> configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action> configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); + public ProcessorDescriptor UserAgent(Action> configure) => Set(configure, "user_agent"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class ProcessorDescriptor : SerializableDescriptor +{ + internal ProcessorDescriptor(Action configure) => configure.Invoke(this); + + public ProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private ProcessorDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private ProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public ProcessorDescriptor Append(AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action configure) => Set(configure, "append"); + public ProcessorDescriptor Append(Action> configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action configure) => Set(configure, "attachment"); + public ProcessorDescriptor Attachment(Action> configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action configure) => Set(configure, "bytes"); + public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action configure) => Set(configure, "circle"); + public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action configure) => Set(configure, "convert"); + public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action configure) => Set(configure, "csv"); + public ProcessorDescriptor Csv(Action> configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action configure) => Set(configure, "date"); + public ProcessorDescriptor Date(Action> configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action> configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action configure) => Set(configure, "dissect"); + public ProcessorDescriptor Dissect(Action> configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor DotExpander(Action> configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action configure) => Set(configure, "drop"); + public ProcessorDescriptor Drop(Action> configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action configure) => Set(configure, "enrich"); + public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action configure) => Set(configure, "fail"); + public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action configure) => Set(configure, "foreach"); + public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action configure) => Set(configure, "geoip"); + public ProcessorDescriptor Geoip(Action> configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action configure) => Set(configure, "grok"); + public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action configure) => Set(configure, "gsub"); + public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action configure) => Set(configure, "inference"); + public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action configure) => Set(configure, "join"); + public ProcessorDescriptor Join(Action> configure) => Set(configure, "join"); + public ProcessorDescriptor Json(JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action configure) => Set(configure, "json"); + public ProcessorDescriptor Json(Action> configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action configure) => Set(configure, "kv"); + public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action configure) => Set(configure, "remove"); + public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action configure) => Set(configure, "rename"); + public ProcessorDescriptor Rename(Action> configure) => Set(configure, "rename"); + public ProcessorDescriptor Set(SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action configure) => Set(configure, "set"); + public ProcessorDescriptor Set(Action> configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action> configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action configure) => Set(configure, "sort"); + public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action configure) => Set(configure, "split"); + public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); + public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action configure) => Set(configure, "uppercase"); + public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); + public ProcessorDescriptor UserAgent(Action configure) => Set(configure, "user_agent"); + public ProcessorDescriptor UserAgent(Action> configure) => Set(configure, "user_agent"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs new file mode 100644 index 00000000000..cd9cab16103 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs @@ -0,0 +1,390 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class RemoveProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Fields to be removed. Supports template snippets. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Fields Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(RemoveProcessor removeProcessor) => Ingest.Processor.Remove(removeProcessor); +} + +public sealed partial class RemoveProcessorDescriptor : SerializableDescriptor> +{ + internal RemoveProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public RemoveProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + + public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public RemoveProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Fields to be removed. Supports template snippets. + /// + public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Fields field) + { + FieldValue = field; + return Self; + } + + public RemoveProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public RemoveProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RemoveProcessorDescriptor : SerializableDescriptor +{ + internal RemoveProcessorDescriptor(Action configure) => configure.Invoke(this); + + public RemoveProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + + public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RemoveProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public RemoveProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// Fields to be removed. Supports template snippets. + /// + public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Fields field) + { + FieldValue = field; + return Self; + } + + public RemoveProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public RemoveProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs new file mode 100644 index 00000000000..15cf0b342c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs @@ -0,0 +1,474 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class RenameProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field TargetField { get; set; } + + public static implicit operator Processor(RenameProcessor renameProcessor) => Ingest.Processor.Rename(renameProcessor); +} + +public sealed partial class RenameProcessorDescriptor : SerializableDescriptor> +{ + internal RenameProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public RenameProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + + public RenameProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RenameProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RenameProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RenameProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public RenameProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RenameProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public RenameProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class RenameProcessorDescriptor : SerializableDescriptor +{ + internal RenameProcessorDescriptor(Action configure) => configure.Invoke(this); + + public RenameProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + + public RenameProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RenameProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RenameProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RenameProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public RenameProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RenameProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public RenameProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The new name of the field.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs new file mode 100644 index 00000000000..b8996821696 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs @@ -0,0 +1,595 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class SetProcessor +{ + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ [JsonInclude, JsonPropertyName("copy_from")] + public Elastic.Clients.Elasticsearch.Serverless.Field? CopyFrom { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_empty_value")] + public bool? IgnoreEmptyValue { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// The media type for encoding `value`.
Applies only when value is a template snippet.
Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.
+ ///
+ [JsonInclude, JsonPropertyName("media_type")] + public string? MediaType { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// If `true` processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ [JsonInclude, JsonPropertyName("override")] + public bool? Override { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The value to be set for the field.
Supports template snippets.
May specify only one of `value` or `copy_from`.
+ ///
+ [JsonInclude, JsonPropertyName("value")] + public object? Value { get; set; } + + public static implicit operator Processor(SetProcessor setProcessor) => Ingest.Processor.Set(setProcessor); +} + +public sealed partial class SetProcessorDescriptor : SerializableDescriptor> +{ + internal SetProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public SetProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? CopyFromValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreEmptyValueValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? MediaTypeValue { get; set; } + private bool? OverrideValue { get; set; } + private string? TagValue { get; set; } + private object? ValueValue { get; set; } + + public SetProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SetProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SetProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SetProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ public SetProcessorDescriptor CopyFrom(Elastic.Clients.Elasticsearch.Serverless.Field? copyFrom) + { + CopyFromValue = copyFrom; + return Self; + } + + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ public SetProcessorDescriptor CopyFrom(Expression> copyFrom) + { + CopyFromValue = copyFrom; + return Self; + } + + public SetProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SetProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + /// + /// If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document. + /// + public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue = true) + { + IgnoreEmptyValueValue = ignoreEmptyValue; + return Self; + } + + public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The media type for encoding `value`.
Applies only when value is a template snippet.
Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.
+ ///
+ public SetProcessorDescriptor MediaType(string? mediaType) + { + MediaTypeValue = mediaType; + return Self; + } + + /// + /// If `true` processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ public SetProcessorDescriptor Override(bool? overrideValue = true) + { + OverrideValue = overrideValue; + return Self; + } + + public SetProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The value to be set for the field.
Supports template snippets.
May specify only one of `value` or `copy_from`.
+ ///
+ public SetProcessorDescriptor Value(object? value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (CopyFromValue is not null) + { + writer.WritePropertyName("copy_from"); + JsonSerializer.Serialize(writer, CopyFromValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreEmptyValueValue.HasValue) + { + writer.WritePropertyName("ignore_empty_value"); + writer.WriteBooleanValue(IgnoreEmptyValueValue.Value); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(MediaTypeValue)) + { + writer.WritePropertyName("media_type"); + writer.WriteStringValue(MediaTypeValue); + } + + if (OverrideValue.HasValue) + { + writer.WritePropertyName("override"); + writer.WriteBooleanValue(OverrideValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SetProcessorDescriptor : SerializableDescriptor +{ + internal SetProcessorDescriptor(Action configure) => configure.Invoke(this); + + public SetProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? CopyFromValue { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreEmptyValueValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? MediaTypeValue { get; set; } + private bool? OverrideValue { get; set; } + private string? TagValue { get; set; } + private object? ValueValue { get; set; } + + public SetProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SetProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SetProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SetProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ public SetProcessorDescriptor CopyFrom(Elastic.Clients.Elasticsearch.Serverless.Field? copyFrom) + { + CopyFromValue = copyFrom; + return Self; + } + + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ public SetProcessorDescriptor CopyFrom(Expression> copyFrom) + { + CopyFromValue = copyFrom; + return Self; + } + + /// + /// The origin field which will be copied to `field`, cannot set `value` simultaneously.
Supported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc.
+ ///
+ public SetProcessorDescriptor CopyFrom(Expression> copyFrom) + { + CopyFromValue = copyFrom; + return Self; + } + + public SetProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SetProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + /// + /// If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document. + /// + public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue = true) + { + IgnoreEmptyValueValue = ignoreEmptyValue; + return Self; + } + + public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The media type for encoding `value`.
Applies only when value is a template snippet.
Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.
+ ///
+ public SetProcessorDescriptor MediaType(string? mediaType) + { + MediaTypeValue = mediaType; + return Self; + } + + /// + /// If `true` processor will update fields with pre-existing non-null-valued field.
When set to `false`, such fields will not be touched.
+ ///
+ public SetProcessorDescriptor Override(bool? overrideValue = true) + { + OverrideValue = overrideValue; + return Self; + } + + public SetProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The value to be set for the field.
Supports template snippets.
May specify only one of `value` or `copy_from`.
+ ///
+ public SetProcessorDescriptor Value(object? value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (CopyFromValue is not null) + { + writer.WritePropertyName("copy_from"); + JsonSerializer.Serialize(writer, CopyFromValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreEmptyValueValue.HasValue) + { + writer.WritePropertyName("ignore_empty_value"); + writer.WriteBooleanValue(IgnoreEmptyValueValue.Value); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (!string.IsNullOrEmpty(MediaTypeValue)) + { + writer.WritePropertyName("media_type"); + writer.WriteStringValue(MediaTypeValue); + } + + if (OverrideValue.HasValue) + { + writer.WritePropertyName("override"); + writer.WriteBooleanValue(OverrideValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs new file mode 100644 index 00000000000..4713858c2c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs @@ -0,0 +1,417 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class SetSecurityUserProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to store the user information into. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Controls what user related properties are added to the field. + /// + [JsonInclude, JsonPropertyName("properties")] + public ICollection? Properties { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Processor(SetSecurityUserProcessor setSecurityUserProcessor) => Ingest.Processor.SetSecurityUser(setSecurityUserProcessor); +} + +public sealed partial class SetSecurityUserProcessorDescriptor : SerializableDescriptor> +{ + internal SetSecurityUserProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public SetSecurityUserProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? TagValue { get; set; } + + public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SetSecurityUserProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SetSecurityUserProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Controls what user related properties are added to the field. + /// + public SetSecurityUserProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + public SetSecurityUserProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SetSecurityUserProcessorDescriptor : SerializableDescriptor +{ + internal SetSecurityUserProcessorDescriptor(Action configure) => configure.Invoke(this); + + public SetSecurityUserProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private ICollection? PropertiesValue { get; set; } + private string? TagValue { get; set; } + + public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SetSecurityUserProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SetSecurityUserProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SetSecurityUserProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Controls what user related properties are added to the field. + /// + public SetSecurityUserProcessorDescriptor Properties(ICollection? properties) + { + PropertiesValue = properties; + return Self; + } + + public SetSecurityUserProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs new file mode 100644 index 00000000000..d1c91dd5829 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class SortProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to be sorted. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// The sort order to use.
Accepts `"asc"` or `"desc"`.
+ ///
+ [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(SortProcessor sortProcessor) => Ingest.Processor.Sort(sortProcessor); +} + +public sealed partial class SortProcessorDescriptor : SerializableDescriptor> +{ + internal SortProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public SortProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public SortProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SortProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SortProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SortProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SortProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SortProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The sort order to use.
Accepts `"asc"` or `"desc"`.
+ ///
+ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public SortProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ public SortProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ public SortProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SortProcessorDescriptor : SerializableDescriptor +{ + internal SortProcessorDescriptor(Action configure) => configure.Invoke(this); + + public SortProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public SortProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SortProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SortProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SortProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SortProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SortProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// The sort order to use.
Accepts `"asc"` or `"desc"`.
+ ///
+ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public SortProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ public SortProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ public SortProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the sorted value to.
By default, the field is updated in-place.
+ ///
+ public SortProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs new file mode 100644 index 00000000000..5ca6424c94d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs @@ -0,0 +1,550 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class SplitProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to split. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Preserves empty trailing fields, if any. + /// + [JsonInclude, JsonPropertyName("preserve_trailing")] + public bool? PreserveTrailing { get; set; } + + /// + /// A regex which matches the separator, for example, `,` or `\s+`. + /// + [JsonInclude, JsonPropertyName("separator")] + public string Separator { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(SplitProcessor splitProcessor) => Ingest.Processor.Split(splitProcessor); +} + +public sealed partial class SplitProcessorDescriptor : SerializableDescriptor> +{ + internal SplitProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public SplitProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? PreserveTrailingValue { get; set; } + private string SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public SplitProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SplitProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SplitProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SplitProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SplitProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SplitProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Preserves empty trailing fields, if any. + /// + public SplitProcessorDescriptor PreserveTrailing(bool? preserveTrailing = true) + { + PreserveTrailingValue = preserveTrailing; + return Self; + } + + /// + /// A regex which matches the separator, for example, `,` or `\s+`. + /// + public SplitProcessorDescriptor Separator(string separator) + { + SeparatorValue = separator; + return Self; + } + + public SplitProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ public SplitProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ public SplitProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PreserveTrailingValue.HasValue) + { + writer.WritePropertyName("preserve_trailing"); + writer.WriteBooleanValue(PreserveTrailingValue.Value); + } + + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SplitProcessorDescriptor : SerializableDescriptor +{ + internal SplitProcessorDescriptor(Action configure) => configure.Invoke(this); + + public SplitProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? PreserveTrailingValue { get; set; } + private string SeparatorValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public SplitProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public SplitProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public SplitProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public SplitProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public SplitProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SplitProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// Preserves empty trailing fields, if any. + /// + public SplitProcessorDescriptor PreserveTrailing(bool? preserveTrailing = true) + { + PreserveTrailingValue = preserveTrailing; + return Self; + } + + /// + /// A regex which matches the separator, for example, `,` or `\s+`. + /// + public SplitProcessorDescriptor Separator(string separator) + { + SeparatorValue = separator; + return Self; + } + + public SplitProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ public SplitProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ public SplitProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the split value to.
By default, the field is updated in-place.
+ ///
+ public SplitProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (PreserveTrailingValue.HasValue) + { + writer.WritePropertyName("preserve_trailing"); + writer.WriteBooleanValue(PreserveTrailingValue.Value); + } + + writer.WritePropertyName("separator"); + writer.WriteStringValue(SeparatorValue); + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs new file mode 100644 index 00000000000..3b2565139be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class TrimProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The string-valued field to trim whitespace from. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(TrimProcessor trimProcessor) => Ingest.Processor.Trim(trimProcessor); +} + +public sealed partial class TrimProcessorDescriptor : SerializableDescriptor> +{ + internal TrimProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public TrimProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public TrimProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TrimProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TrimProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TrimProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public TrimProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TrimProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public TrimProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ public TrimProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ public TrimProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TrimProcessorDescriptor : SerializableDescriptor +{ + internal TrimProcessorDescriptor(Action configure) => configure.Invoke(this); + + public TrimProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public TrimProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TrimProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TrimProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TrimProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public TrimProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TrimProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public TrimProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ public TrimProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ public TrimProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the trimmed value to.
By default, the field is updated in-place.
+ ///
+ public TrimProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs new file mode 100644 index 00000000000..042f06114c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class UppercaseProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to make uppercase. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(UppercaseProcessor uppercaseProcessor) => Ingest.Processor.Uppercase(uppercaseProcessor); +} + +public sealed partial class UppercaseProcessorDescriptor : SerializableDescriptor> +{ + internal UppercaseProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public UppercaseProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UppercaseProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UppercaseProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UppercaseProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UppercaseProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UppercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UppercaseProcessorDescriptor : SerializableDescriptor +{ + internal UppercaseProcessorDescriptor(Action configure) => configure.Invoke(this); + + public UppercaseProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UppercaseProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UppercaseProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UppercaseProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UppercaseProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UppercaseProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UppercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UppercaseProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs new file mode 100644 index 00000000000..b7ba9ca1503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs @@ -0,0 +1,482 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class UrlDecodeProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field to decode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(UrlDecodeProcessor urlDecodeProcessor) => Ingest.Processor.UrlDecode(urlDecodeProcessor); +} + +public sealed partial class UrlDecodeProcessorDescriptor : SerializableDescriptor> +{ + internal UrlDecodeProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public UrlDecodeProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UrlDecodeProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UrlDecodeProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UrlDecodeProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UrlDecodeProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UrlDecodeProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UrlDecodeProcessorDescriptor : SerializableDescriptor +{ + internal UrlDecodeProcessorDescriptor(Action configure) => configure.Invoke(this); + + public UrlDecodeProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UrlDecodeProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UrlDecodeProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UrlDecodeProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. + /// + public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UrlDecodeProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UrlDecodeProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UrlDecodeProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field to assign the converted value to.
By default, the field is updated in-place.
+ ///
+ public UrlDecodeProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs new file mode 100644 index 00000000000..c2e634c2be7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs @@ -0,0 +1,548 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; + +public sealed partial class UserAgentProcessor +{ + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The field containing the user agent string. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + [JsonInclude, JsonPropertyName("options")] + public ICollection? Options { get; set; } + + /// + /// The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with. + /// + [JsonInclude, JsonPropertyName("regex_file")] + public string? RegexFile { get; set; } + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// The field that will be filled with the user agent details. + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Processor(UserAgentProcessor userAgentProcessor) => Ingest.Processor.UserAgent(userAgentProcessor); +} + +public sealed partial class UserAgentProcessorDescriptor : SerializableDescriptor> +{ + internal UserAgentProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public UserAgentProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OptionsValue { get; set; } + private string? RegexFileValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UserAgentProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UserAgentProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UserAgentProcessorDescriptor Options(ICollection? options) + { + OptionsValue = options; + return Self; + } + + /// + /// The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with. + /// + public UserAgentProcessorDescriptor RegexFile(string? regexFile) + { + RegexFileValue = regexFile; + return Self; + } + + public UserAgentProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will be filled with the user agent details. + /// + public UserAgentProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will be filled with the user agent details. + /// + public UserAgentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (!string.IsNullOrEmpty(RegexFileValue)) + { + writer.WritePropertyName("regex_file"); + writer.WriteStringValue(RegexFileValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UserAgentProcessorDescriptor : SerializableDescriptor +{ + internal UserAgentProcessorDescriptor(Action configure) => configure.Invoke(this); + + public UserAgentProcessorDescriptor() : base() + { + } + + private ICollection? OnFailureValue { get; set; } + private ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OptionsValue { get; set; } + private string? RegexFileValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UserAgentProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + public UserAgentProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UserAgentProcessorDescriptor If(string? ifValue) + { + IfValue = ifValue; + return Self; + } + + public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// If `true` and `field` does not exist, the processor quietly exits without modifying the document. + /// + public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + public UserAgentProcessorDescriptor Options(ICollection? options) + { + OptionsValue = options; + return Self; + } + + /// + /// The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with. + /// + public UserAgentProcessorDescriptor RegexFile(string? regexFile) + { + RegexFileValue = regexFile; + return Self; + } + + public UserAgentProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// The field that will be filled with the user agent details. + /// + public UserAgentProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will be filled with the user agent details. + /// + public UserAgentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// The field that will be filled with the user agent details. + /// + public UserAgentProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (!string.IsNullOrEmpty(RegexFileValue)) + { + writer.WritePropertyName("regex_file"); + writer.WriteStringValue(RegexFileValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs new file mode 100644 index 00000000000..0c60ac70aa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class InlineGet +{ + [JsonInclude, JsonPropertyName("_primary_term")] + public long? PrimaryTerm { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("_seq_no")] + public long? SeqNo { get; init; } + [JsonInclude, JsonPropertyName("_source")] + [SourceConverter] + public TDocument Source { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } + [JsonInclude, JsonPropertyName("metadata")] + public IReadOnlyDictionary Metadata { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs new file mode 100644 index 00000000000..ee361d630b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class InlineScript +{ + /// + /// Specifies the language the script is written in. + /// + [JsonInclude, JsonPropertyName("lang")] + public Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage? Language { get; set; } + [JsonInclude, JsonPropertyName("options")] + public IDictionary? Options { get; set; } + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + + /// + /// The script source. + /// + [JsonInclude, JsonPropertyName("source")] + public string Source { get; set; } +} + +public sealed partial class InlineScriptDescriptor : SerializableDescriptor +{ + internal InlineScriptDescriptor(Action configure) => configure.Invoke(this); + + public InlineScriptDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage? LanguageValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private IDictionary? ParamsValue { get; set; } + private string SourceValue { get; set; } + + /// + /// Specifies the language the script is written in. + /// + public InlineScriptDescriptor Language(Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage? language) + { + LanguageValue = language; + return Self; + } + + public InlineScriptDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public InlineScriptDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The script source. + /// + public InlineScriptDescriptor Source(string source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LanguageValue is not null) + { + writer.WritePropertyName("lang"); + JsonSerializer.Serialize(writer, LanguageValue, options); + } + + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs new file mode 100644 index 00000000000..28c37a6a256 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs @@ -0,0 +1,542 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class KnnQuery +{ + /// + /// Boost value to apply to kNN scores + /// + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The name of the vector field to search against + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Filters for the kNN search query + /// + [JsonInclude, JsonPropertyName("filter"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] + public ICollection? Filter { get; set; } + + /// + /// The final number of nearest neighbors to return as top hits + /// + [JsonInclude, JsonPropertyName("k")] + public long k { get; set; } + + /// + /// The number of nearest neighbor candidates to consider per shard + /// + [JsonInclude, JsonPropertyName("num_candidates")] + public long NumCandidates { get; set; } + + /// + /// The query vector + /// + [JsonInclude, JsonPropertyName("query_vector")] + public ICollection? QueryVector { get; set; } + + /// + /// The query vector builder. You must provide a query_vector_builder or query_vector, but not both. + /// + [JsonInclude, JsonPropertyName("query_vector_builder")] + public Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder? QueryVectorBuilder { get; set; } + + /// + /// The minimum similarity for a vector to be considered a match + /// + [JsonInclude, JsonPropertyName("similarity")] + public float? Similarity { get; set; } +} + +public sealed partial class KnnQueryDescriptor : SerializableDescriptor> +{ + internal KnnQueryDescriptor(Action> configure) => configure.Invoke(this); + + public KnnQueryDescriptor() : base() + { + } + + private ICollection? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private long kValue { get; set; } + private long NumCandidatesValue { get; set; } + private ICollection? QueryVectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder? QueryVectorBuilderValue { get; set; } + private QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } + private float? SimilarityValue { get; set; } + + /// + /// Filters for the kNN search query + /// + public KnnQueryDescriptor Filter(ICollection? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterValue = filter; + return Self; + } + + public KnnQueryDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorActions = null; + FilterDescriptorAction = configure; + return Self; + } + + public KnnQueryDescriptor Filter(params Action>[] configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = configure; + return Self; + } + + /// + /// Boost value to apply to kNN scores + /// + public KnnQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The final number of nearest neighbors to return as top hits + /// + public KnnQueryDescriptor k(long k) + { + kValue = k; + return Self; + } + + /// + /// The number of nearest neighbor candidates to consider per shard + /// + public KnnQueryDescriptor NumCandidates(long numCandidates) + { + NumCandidatesValue = numCandidates; + return Self; + } + + /// + /// The query vector + /// + public KnnQueryDescriptor QueryVector(ICollection? queryVector) + { + QueryVectorValue = queryVector; + return Self; + } + + /// + /// The query vector builder. You must provide a query_vector_builder or query_vector, but not both. + /// + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder? queryVectorBuilder) + { + QueryVectorBuilderDescriptor = null; + QueryVectorBuilderDescriptorAction = null; + QueryVectorBuilderValue = queryVectorBuilder; + return Self; + } + + public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + { + QueryVectorBuilderValue = null; + QueryVectorBuilderDescriptorAction = null; + QueryVectorBuilderDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor QueryVectorBuilder(Action configure) + { + QueryVectorBuilderValue = null; + QueryVectorBuilderDescriptor = null; + QueryVectorBuilderDescriptorAction = configure; + return Self; + } + + /// + /// The minimum similarity for a vector to be considered a match + /// + public KnnQueryDescriptor Similarity(float? similarity) + { + SimilarityValue = similarity; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterDescriptorActions is not null) + { + writer.WritePropertyName("filter"); + if (FilterDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in FilterDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + } + + if (FilterDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + SingleOrManySerializationHelper.Serialize(FilterValue, writer, options); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue); + writer.WritePropertyName("num_candidates"); + writer.WriteNumberValue(NumCandidatesValue); + if (QueryVectorValue is not null) + { + writer.WritePropertyName("query_vector"); + JsonSerializer.Serialize(writer, QueryVectorValue, options); + } + + if (QueryVectorBuilderDescriptor is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, QueryVectorBuilderDescriptor, options); + } + else if (QueryVectorBuilderDescriptorAction is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + } + else if (QueryVectorBuilderValue is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, QueryVectorBuilderValue, options); + } + + if (SimilarityValue.HasValue) + { + writer.WritePropertyName("similarity"); + writer.WriteNumberValue(SimilarityValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class KnnQueryDescriptor : SerializableDescriptor +{ + internal KnnQueryDescriptor(Action configure) => configure.Invoke(this); + + public KnnQueryDescriptor() : base() + { + } + + private ICollection? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private long kValue { get; set; } + private long NumCandidatesValue { get; set; } + private ICollection? QueryVectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder? QueryVectorBuilderValue { get; set; } + private QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } + private float? SimilarityValue { get; set; } + + /// + /// Filters for the kNN search query + /// + public KnnQueryDescriptor Filter(ICollection? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterValue = filter; + return Self; + } + + public KnnQueryDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorActions = null; + FilterDescriptorAction = configure; + return Self; + } + + public KnnQueryDescriptor Filter(params Action[] configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = configure; + return Self; + } + + /// + /// Boost value to apply to kNN scores + /// + public KnnQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The final number of nearest neighbors to return as top hits + /// + public KnnQueryDescriptor k(long k) + { + kValue = k; + return Self; + } + + /// + /// The number of nearest neighbor candidates to consider per shard + /// + public KnnQueryDescriptor NumCandidates(long numCandidates) + { + NumCandidatesValue = numCandidates; + return Self; + } + + /// + /// The query vector + /// + public KnnQueryDescriptor QueryVector(ICollection? queryVector) + { + QueryVectorValue = queryVector; + return Self; + } + + /// + /// The query vector builder. You must provide a query_vector_builder or query_vector, but not both. + /// + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder? queryVectorBuilder) + { + QueryVectorBuilderDescriptor = null; + QueryVectorBuilderDescriptorAction = null; + QueryVectorBuilderValue = queryVectorBuilder; + return Self; + } + + public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + { + QueryVectorBuilderValue = null; + QueryVectorBuilderDescriptorAction = null; + QueryVectorBuilderDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor QueryVectorBuilder(Action configure) + { + QueryVectorBuilderValue = null; + QueryVectorBuilderDescriptor = null; + QueryVectorBuilderDescriptorAction = configure; + return Self; + } + + /// + /// The minimum similarity for a vector to be considered a match + /// + public KnnQueryDescriptor Similarity(float? similarity) + { + SimilarityValue = similarity; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterDescriptorActions is not null) + { + writer.WritePropertyName("filter"); + if (FilterDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in FilterDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + } + + if (FilterDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + SingleOrManySerializationHelper.Serialize(FilterValue, writer, options); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("k"); + writer.WriteNumberValue(kValue); + writer.WritePropertyName("num_candidates"); + writer.WriteNumberValue(NumCandidatesValue); + if (QueryVectorValue is not null) + { + writer.WritePropertyName("query_vector"); + JsonSerializer.Serialize(writer, QueryVectorValue, options); + } + + if (QueryVectorBuilderDescriptor is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, QueryVectorBuilderDescriptor, options); + } + else if (QueryVectorBuilderDescriptorAction is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + } + else if (QueryVectorBuilderValue is not null) + { + writer.WritePropertyName("query_vector_builder"); + JsonSerializer.Serialize(writer, QueryVectorBuilderValue, options); + } + + if (SimilarityValue.HasValue) + { + writer.WritePropertyName("similarity"); + writer.WriteNumberValue(SimilarityValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LatLonGeoLocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LatLonGeoLocation.g.cs new file mode 100644 index 00000000000..e02b0a0b8c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LatLonGeoLocation.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class LatLonGeoLocation +{ + /// + /// Latitude + /// + [JsonInclude, JsonPropertyName("lat")] + public double Lat { get; set; } + + /// + /// Longitude + /// + [JsonInclude, JsonPropertyName("lon")] + public double Lon { get; set; } +} + +public sealed partial class LatLonGeoLocationDescriptor : SerializableDescriptor +{ + internal LatLonGeoLocationDescriptor(Action configure) => configure.Invoke(this); + + public LatLonGeoLocationDescriptor() : base() + { + } + + private double LatValue { get; set; } + private double LonValue { get; set; } + + /// + /// Latitude + /// + public LatLonGeoLocationDescriptor Lat(double lat) + { + LatValue = lat; + return Self; + } + + /// + /// Longitude + /// + public LatLonGeoLocationDescriptor Lon(double lon) + { + LonValue = lon; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("lat"); + writer.WriteNumberValue(LatValue); + writer.WritePropertyName("lon"); + writer.WriteNumberValue(LonValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs new file mode 100644 index 00000000000..7b7780c69a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs @@ -0,0 +1,359 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class AggregateMetricDoubleProperty : IProperty +{ + [JsonInclude, JsonPropertyName("default_metric")] + public string DefaultMetric { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("metrics")] + public ICollection Metrics { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "aggregate_metric_double"; +} + +public sealed partial class AggregateMetricDoublePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal AggregateMetricDoublePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public AggregateMetricDoublePropertyDescriptor() : base() + { + } + + private string DefaultMetricValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public AggregateMetricDoublePropertyDescriptor DefaultMetric(string defaultMetric) + { + DefaultMetricValue = defaultMetric; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Metrics(ICollection metrics) + { + MetricsValue = metrics; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_metric"); + writer.WriteStringValue(DefaultMetricValue); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("aggregate_metric_double"); + writer.WriteEndObject(); + } + + AggregateMetricDoubleProperty IBuildableDescriptor.Build() => new() + { + DefaultMetric = DefaultMetricValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Metrics = MetricsValue, + Properties = PropertiesValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class AggregateMetricDoublePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal AggregateMetricDoublePropertyDescriptor(Action configure) => configure.Invoke(this); + + public AggregateMetricDoublePropertyDescriptor() : base() + { + } + + private string DefaultMetricValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private ICollection MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public AggregateMetricDoublePropertyDescriptor DefaultMetric(string defaultMetric) + { + DefaultMetricValue = defaultMetric; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Metrics(ICollection metrics) + { + MetricsValue = metrics; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public AggregateMetricDoublePropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_metric"); + writer.WriteStringValue(DefaultMetricValue); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("aggregate_metric_double"); + writer.WriteEndObject(); + } + + AggregateMetricDoubleProperty IBuildableDescriptor.Build() => new() + { + DefaultMetric = DefaultMetricValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Metrics = MetricsValue, + Properties = PropertiesValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AllField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AllField.g.cs new file mode 100644 index 00000000000..bff87e21bdd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AllField.g.cs @@ -0,0 +1,158 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class AllField +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string Analyzer { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } + [JsonInclude, JsonPropertyName("omit_norms")] + public bool OmitNorms { get; set; } + [JsonInclude, JsonPropertyName("search_analyzer")] + public string SearchAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool Store { get; set; } + [JsonInclude, JsonPropertyName("store_term_vector_offsets")] + public bool StoreTermVectorOffsets { get; set; } + [JsonInclude, JsonPropertyName("store_term_vector_payloads")] + public bool StoreTermVectorPayloads { get; set; } + [JsonInclude, JsonPropertyName("store_term_vector_positions")] + public bool StoreTermVectorPositions { get; set; } + [JsonInclude, JsonPropertyName("store_term_vectors")] + public bool StoreTermVectors { get; set; } +} + +public sealed partial class AllFieldDescriptor : SerializableDescriptor +{ + internal AllFieldDescriptor(Action configure) => configure.Invoke(this); + + public AllFieldDescriptor() : base() + { + } + + private string AnalyzerValue { get; set; } + private bool EnabledValue { get; set; } + private bool OmitNormsValue { get; set; } + private string SearchAnalyzerValue { get; set; } + private string SimilarityValue { get; set; } + private bool StoreValue { get; set; } + private bool StoreTermVectorOffsetsValue { get; set; } + private bool StoreTermVectorPayloadsValue { get; set; } + private bool StoreTermVectorPositionsValue { get; set; } + private bool StoreTermVectorsValue { get; set; } + + public AllFieldDescriptor Analyzer(string analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public AllFieldDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public AllFieldDescriptor OmitNorms(bool omitNorms = true) + { + OmitNormsValue = omitNorms; + return Self; + } + + public AllFieldDescriptor SearchAnalyzer(string searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public AllFieldDescriptor Similarity(string similarity) + { + SimilarityValue = similarity; + return Self; + } + + public AllFieldDescriptor Store(bool store = true) + { + StoreValue = store; + return Self; + } + + public AllFieldDescriptor StoreTermVectorOffsets(bool storeTermVectorOffsets = true) + { + StoreTermVectorOffsetsValue = storeTermVectorOffsets; + return Self; + } + + public AllFieldDescriptor StoreTermVectorPayloads(bool storeTermVectorPayloads = true) + { + StoreTermVectorPayloadsValue = storeTermVectorPayloads; + return Self; + } + + public AllFieldDescriptor StoreTermVectorPositions(bool storeTermVectorPositions = true) + { + StoreTermVectorPositionsValue = storeTermVectorPositions; + return Self; + } + + public AllFieldDescriptor StoreTermVectors(bool storeTermVectors = true) + { + StoreTermVectorsValue = storeTermVectors; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WritePropertyName("omit_norms"); + writer.WriteBooleanValue(OmitNormsValue); + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue); + writer.WritePropertyName("store_term_vector_offsets"); + writer.WriteBooleanValue(StoreTermVectorOffsetsValue); + writer.WritePropertyName("store_term_vector_payloads"); + writer.WriteBooleanValue(StoreTermVectorPayloadsValue); + writer.WritePropertyName("store_term_vector_positions"); + writer.WriteBooleanValue(StoreTermVectorPositionsValue); + writer.WritePropertyName("store_term_vectors"); + writer.WriteBooleanValue(StoreTermVectorsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs new file mode 100644 index 00000000000..2e89f8f5d36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs @@ -0,0 +1,405 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class BinaryProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "binary"; +} + +public sealed partial class BinaryPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal BinaryPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public BinaryPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public BinaryPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public BinaryPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public BinaryPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public BinaryPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("binary"); + writer.WriteEndObject(); + } + + BinaryProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class BinaryPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal BinaryPropertyDescriptor(Action configure) => configure.Invoke(this); + + public BinaryPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public BinaryPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public BinaryPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public BinaryPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BinaryPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public BinaryPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("binary"); + writer.WriteEndObject(); + } + + BinaryProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs new file mode 100644 index 00000000000..1ee8ffe1ba7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs @@ -0,0 +1,633 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class BooleanProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fielddata")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? Fielddata { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public bool? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "boolean"; +} + +public sealed partial class BooleanPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal BooleanPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public BooleanPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? FielddataValue { get; set; } + private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public BooleanPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public BooleanPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public BooleanPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public BooleanPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? fielddata) + { + FielddataDescriptor = null; + FielddataDescriptorAction = null; + FielddataValue = fielddata; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + { + FielddataValue = null; + FielddataDescriptorAction = null; + FielddataDescriptor = descriptor; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(Action configure) + { + FielddataValue = null; + FielddataDescriptor = null; + FielddataDescriptorAction = configure; + return Self; + } + + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public BooleanPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BooleanPropertyDescriptor NullValue(bool? nullValue = true) + { + NullValueValue = nullValue; + return Self; + } + + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public BooleanPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FielddataDescriptor is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataDescriptor, options); + } + else if (FielddataDescriptorAction is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + } + else if (FielddataValue is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteBooleanValue(NullValueValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("boolean"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? BuildFielddata() + { + if (FielddataValue is not null) + { + return FielddataValue; + } + + if (FielddataDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataDescriptorAction is not null) + { + var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + BooleanProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fielddata = BuildFielddata(), + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class BooleanPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal BooleanPropertyDescriptor(Action configure) => configure.Invoke(this); + + public BooleanPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? FielddataValue { get; set; } + private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public BooleanPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public BooleanPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public BooleanPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public BooleanPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? fielddata) + { + FielddataDescriptor = null; + FielddataDescriptorAction = null; + FielddataValue = fielddata; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + { + FielddataValue = null; + FielddataDescriptorAction = null; + FielddataDescriptor = descriptor; + return Self; + } + + public BooleanPropertyDescriptor Fielddata(Action configure) + { + FielddataValue = null; + FielddataDescriptor = null; + FielddataDescriptorAction = configure; + return Self; + } + + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public BooleanPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BooleanPropertyDescriptor NullValue(bool? nullValue = true) + { + NullValueValue = nullValue; + return Self; + } + + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public BooleanPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public BooleanPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FielddataDescriptor is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataDescriptor, options); + } + else if (FielddataDescriptorAction is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + } + else if (FielddataValue is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteBooleanValue(NullValueValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("boolean"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? BuildFielddata() + { + if (FielddataValue is not null) + { + return FielddataValue; + } + + if (FielddataDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataDescriptorAction is not null) + { + var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + BooleanProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fielddata = BuildFielddata(), + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs new file mode 100644 index 00000000000..faf25d2adf7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class ByteNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public double? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "byte"; +} + +public sealed partial class ByteNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ByteNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ByteNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ByteNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ByteNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ByteNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ByteNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ByteNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ByteNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ByteNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ByteNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ByteNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("byte"); + writer.WriteEndObject(); + } + + ByteNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class ByteNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ByteNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public ByteNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ByteNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ByteNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ByteNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ByteNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ByteNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ByteNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ByteNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ByteNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ByteNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ByteNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("byte"); + writer.WriteEndObject(); + } + + ByteNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs new file mode 100644 index 00000000000..b487e4e7fa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs @@ -0,0 +1,701 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class CompletionProperty : IProperty +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("contexts")] + public ICollection? Contexts { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("max_input_length")] + public int? MaxInputLength { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("preserve_position_increments")] + public bool? PreservePositionIncrements { get; set; } + [JsonInclude, JsonPropertyName("preserve_separators")] + public bool? PreserveSeparators { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("search_analyzer")] + public string? SearchAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "completion"; +} + +public sealed partial class CompletionPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal CompletionPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public CompletionPropertyDescriptor() : base() + { + } + + private ICollection? ContextsValue { get; set; } + private SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action> ContextsDescriptorAction { get; set; } + private Action>[] ContextsDescriptorActions { get; set; } + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private int? MaxInputLengthValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? PreservePositionIncrementsValue { get; set; } + private bool? PreserveSeparatorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public CompletionPropertyDescriptor Contexts(ICollection? contexts) + { + ContextsDescriptor = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = null; + ContextsValue = contexts; + return Self; + } + + public CompletionPropertyDescriptor Contexts(SuggestContextDescriptor descriptor) + { + ContextsValue = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = null; + ContextsDescriptor = descriptor; + return Self; + } + + public CompletionPropertyDescriptor Contexts(Action> configure) + { + ContextsValue = null; + ContextsDescriptor = null; + ContextsDescriptorActions = null; + ContextsDescriptorAction = configure; + return Self; + } + + public CompletionPropertyDescriptor Contexts(params Action>[] configure) + { + ContextsValue = null; + ContextsDescriptor = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = configure; + return Self; + } + + public CompletionPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public CompletionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public CompletionPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public CompletionPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public CompletionPropertyDescriptor MaxInputLength(int? maxInputLength) + { + MaxInputLengthValue = maxInputLength; + return Self; + } + + public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CompletionPropertyDescriptor PreservePositionIncrements(bool? preservePositionIncrements = true) + { + PreservePositionIncrementsValue = preservePositionIncrements; + return Self; + } + + public CompletionPropertyDescriptor PreserveSeparators(bool? preserveSeparators = true) + { + PreserveSeparatorsValue = preserveSeparators; + return Self; + } + + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public CompletionPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public CompletionPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ContextsDescriptor is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ContextsDescriptor, options); + writer.WriteEndArray(); + } + else if (ContextsDescriptorAction is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ContextsDescriptorActions is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + foreach (var action in ContextsDescriptorActions) + { + JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ContextsValue is not null) + { + writer.WritePropertyName("contexts"); + JsonSerializer.Serialize(writer, ContextsValue, options); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MaxInputLengthValue.HasValue) + { + writer.WritePropertyName("max_input_length"); + writer.WriteNumberValue(MaxInputLengthValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PreservePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("preserve_position_increments"); + writer.WriteBooleanValue(PreservePositionIncrementsValue.Value); + } + + if (PreserveSeparatorsValue.HasValue) + { + writer.WritePropertyName("preserve_separators"); + writer.WriteBooleanValue(PreserveSeparatorsValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("completion"); + writer.WriteEndObject(); + } + + CompletionProperty IBuildableDescriptor.Build() => new() + { + Contexts = ContextsValue, + Analyzer = AnalyzerValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + MaxInputLength = MaxInputLengthValue, + Meta = MetaValue, + PreservePositionIncrements = PreservePositionIncrementsValue, + PreserveSeparators = PreserveSeparatorsValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class CompletionPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal CompletionPropertyDescriptor(Action configure) => configure.Invoke(this); + + public CompletionPropertyDescriptor() : base() + { + } + + private ICollection? ContextsValue { get; set; } + private SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action ContextsDescriptorAction { get; set; } + private Action[] ContextsDescriptorActions { get; set; } + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private int? MaxInputLengthValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? PreservePositionIncrementsValue { get; set; } + private bool? PreserveSeparatorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public CompletionPropertyDescriptor Contexts(ICollection? contexts) + { + ContextsDescriptor = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = null; + ContextsValue = contexts; + return Self; + } + + public CompletionPropertyDescriptor Contexts(SuggestContextDescriptor descriptor) + { + ContextsValue = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = null; + ContextsDescriptor = descriptor; + return Self; + } + + public CompletionPropertyDescriptor Contexts(Action configure) + { + ContextsValue = null; + ContextsDescriptor = null; + ContextsDescriptorActions = null; + ContextsDescriptorAction = configure; + return Self; + } + + public CompletionPropertyDescriptor Contexts(params Action[] configure) + { + ContextsValue = null; + ContextsDescriptor = null; + ContextsDescriptorAction = null; + ContextsDescriptorActions = configure; + return Self; + } + + public CompletionPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public CompletionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public CompletionPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public CompletionPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public CompletionPropertyDescriptor MaxInputLength(int? maxInputLength) + { + MaxInputLengthValue = maxInputLength; + return Self; + } + + public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public CompletionPropertyDescriptor PreservePositionIncrements(bool? preservePositionIncrements = true) + { + PreservePositionIncrementsValue = preservePositionIncrements; + return Self; + } + + public CompletionPropertyDescriptor PreserveSeparators(bool? preserveSeparators = true) + { + PreserveSeparatorsValue = preserveSeparators; + return Self; + } + + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public CompletionPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public CompletionPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public CompletionPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ContextsDescriptor is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ContextsDescriptor, options); + writer.WriteEndArray(); + } + else if (ContextsDescriptorAction is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ContextsDescriptorActions is not null) + { + writer.WritePropertyName("contexts"); + writer.WriteStartArray(); + foreach (var action in ContextsDescriptorActions) + { + JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ContextsValue is not null) + { + writer.WritePropertyName("contexts"); + JsonSerializer.Serialize(writer, ContextsValue, options); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MaxInputLengthValue.HasValue) + { + writer.WritePropertyName("max_input_length"); + writer.WriteNumberValue(MaxInputLengthValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PreservePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("preserve_position_increments"); + writer.WriteBooleanValue(PreservePositionIncrementsValue.Value); + } + + if (PreserveSeparatorsValue.HasValue) + { + writer.WritePropertyName("preserve_separators"); + writer.WriteBooleanValue(PreserveSeparatorsValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("completion"); + writer.WriteEndObject(); + } + + CompletionProperty IBuildableDescriptor.Build() => new() + { + Contexts = ContextsValue, + Analyzer = AnalyzerValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + MaxInputLength = MaxInputLengthValue, + Meta = MetaValue, + PreservePositionIncrements = PreservePositionIncrementsValue, + PreserveSeparators = PreserveSeparatorsValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs new file mode 100644 index 00000000000..b88a3e4ad68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs @@ -0,0 +1,316 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class ConstantKeywordProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "constant_keyword"; + + [JsonInclude, JsonPropertyName("value")] + public object? Value { get; set; } +} + +public sealed partial class ConstantKeywordPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ConstantKeywordPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ConstantKeywordPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private object? ValueValue { get; set; } + + public ConstantKeywordPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Value(object? value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("constant_keyword"); + if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + writer.WriteEndObject(); + } + + ConstantKeywordProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Value = ValueValue + }; +} + +public sealed partial class ConstantKeywordPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ConstantKeywordPropertyDescriptor(Action configure) => configure.Invoke(this); + + public ConstantKeywordPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private object? ValueValue { get; set; } + + public ConstantKeywordPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ConstantKeywordPropertyDescriptor Value(object? value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("constant_keyword"); + if (ValueValue is not null) + { + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + } + + writer.WriteEndObject(); + } + + ConstantKeywordProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Value = ValueValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DataStreamTimestamp.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DataStreamTimestamp.g.cs new file mode 100644 index 00000000000..084ba29b64a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DataStreamTimestamp.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DataStreamTimestamp +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class DataStreamTimestampDescriptor : SerializableDescriptor +{ + internal DataStreamTimestampDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamTimestampDescriptor() : base() + { + } + + private bool EnabledValue { get; set; } + + public DataStreamTimestampDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs new file mode 100644 index 00000000000..23cca717814 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs @@ -0,0 +1,585 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DateNanosProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public DateTimeOffset? NullValue { get; set; } + [JsonInclude, JsonPropertyName("precision_step")] + public int? PrecisionStep { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "date_nanos"; +} + +public sealed partial class DateNanosPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DateNanosPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DateNanosPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private DateTimeOffset? NullValueValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DateNanosPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DateNanosPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DateNanosPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DateNanosPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateNanosPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DateNanosPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DateNanosPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateNanosPropertyDescriptor NullValue(DateTimeOffset? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DateNanosPropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DateNanosPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date_nanos"); + writer.WriteEndObject(); + } + + DateNanosProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class DateNanosPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DateNanosPropertyDescriptor(Action configure) => configure.Invoke(this); + + public DateNanosPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private DateTimeOffset? NullValueValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DateNanosPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DateNanosPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DateNanosPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DateNanosPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateNanosPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DateNanosPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DateNanosPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateNanosPropertyDescriptor NullValue(DateTimeOffset? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DateNanosPropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateNanosPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DateNanosPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date_nanos"); + writer.WriteEndObject(); + } + + DateNanosProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs new file mode 100644 index 00000000000..ac12570bc56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs @@ -0,0 +1,753 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DateProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fielddata")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? Fielddata { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("locale")] + public string? Locale { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public DateTimeOffset? NullValue { get; set; } + [JsonInclude, JsonPropertyName("precision_step")] + public int? PrecisionStep { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "date"; +} + +public sealed partial class DatePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DatePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DatePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? FielddataValue { get; set; } + private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private string? LocaleValue { get; set; } + private IDictionary? MetaValue { get; set; } + private DateTimeOffset? NullValueValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DatePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DatePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DatePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DatePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? fielddata) + { + FielddataDescriptor = null; + FielddataDescriptorAction = null; + FielddataValue = fielddata; + return Self; + } + + public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + { + FielddataValue = null; + FielddataDescriptorAction = null; + FielddataDescriptor = descriptor; + return Self; + } + + public DatePropertyDescriptor Fielddata(Action configure) + { + FielddataValue = null; + FielddataDescriptor = null; + FielddataDescriptorAction = configure; + return Self; + } + + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DatePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DatePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DatePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DatePropertyDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DatePropertyDescriptor NullValue(DateTimeOffset? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DatePropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DatePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FielddataDescriptor is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataDescriptor, options); + } + else if (FielddataDescriptorAction is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + } + else if (FielddataValue is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? BuildFielddata() + { + if (FielddataValue is not null) + { + return FielddataValue; + } + + if (FielddataDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataDescriptorAction is not null) + { + var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DateProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fielddata = BuildFielddata(), + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Locale = LocaleValue, + Meta = MetaValue, + NullValue = NullValueValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class DatePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DatePropertyDescriptor(Action configure) => configure.Invoke(this); + + public DatePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? FielddataValue { get; set; } + private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private string? LocaleValue { get; set; } + private IDictionary? MetaValue { get; set; } + private DateTimeOffset? NullValueValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DatePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DatePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DatePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DatePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? fielddata) + { + FielddataDescriptor = null; + FielddataDescriptorAction = null; + FielddataValue = fielddata; + return Self; + } + + public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + { + FielddataValue = null; + FielddataDescriptorAction = null; + FielddataDescriptor = descriptor; + return Self; + } + + public DatePropertyDescriptor Fielddata(Action configure) + { + FielddataValue = null; + FielddataDescriptor = null; + FielddataDescriptorAction = configure; + return Self; + } + + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DatePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DatePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DatePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DatePropertyDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DatePropertyDescriptor NullValue(DateTimeOffset? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DatePropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DatePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DatePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FielddataDescriptor is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataDescriptor, options); + } + else if (FielddataDescriptorAction is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + } + else if (FielddataValue is not null) + { + writer.WritePropertyName("fielddata"); + JsonSerializer.Serialize(writer, FielddataValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddata? BuildFielddata() + { + if (FielddataValue is not null) + { + return FielddataValue; + } + + if (FielddataDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataDescriptorAction is not null) + { + var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DateProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fielddata = BuildFielddata(), + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Locale = LocaleValue, + Meta = MetaValue, + NullValue = NullValueValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs new file mode 100644 index 00000000000..3630f1acbf3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs @@ -0,0 +1,525 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DateRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "date_range"; +} + +public sealed partial class DateRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DateRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DateRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DateRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DateRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DateRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DateRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DateRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DateRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DateRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date_range"); + writer.WriteEndObject(); + } + + DateRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class DateRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DateRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public DateRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DateRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DateRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DateRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DateRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DateRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DateRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DateRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DateRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("date_range"); + writer.WriteEndObject(); + } + + DateRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs new file mode 100644 index 00000000000..c767be38095 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DenseVectorIndexOptions +{ + [JsonInclude, JsonPropertyName("ef_construction")] + public int EfConstruction { get; set; } + [JsonInclude, JsonPropertyName("m")] + public int m { get; set; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; set; } +} + +public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DenseVectorIndexOptionsDescriptor(Action configure) => configure.Invoke(this); + + public DenseVectorIndexOptionsDescriptor() : base() + { + } + + private int EfConstructionValue { get; set; } + private int mValue { get; set; } + private string TypeValue { get; set; } + + public DenseVectorIndexOptionsDescriptor EfConstruction(int efConstruction) + { + EfConstructionValue = efConstruction; + return Self; + } + + public DenseVectorIndexOptionsDescriptor m(int m) + { + mValue = m; + return Self; + } + + public DenseVectorIndexOptionsDescriptor Type(string type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("ef_construction"); + writer.WriteNumberValue(EfConstructionValue); + writer.WritePropertyName("m"); + writer.WriteNumberValue(mValue); + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); + writer.WriteEndObject(); + } + + DenseVectorIndexOptions IBuildableDescriptor.Build() => new() + { + EfConstruction = EfConstructionValue, + m = mValue, + Type = TypeValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs new file mode 100644 index 00000000000..326b84c60f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -0,0 +1,505 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DenseVectorProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dims")] + public int Dims { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "dense_vector"; +} + +public sealed partial class DenseVectorPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DenseVectorPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DenseVectorPropertyDescriptor() : base() + { + } + + private int DimsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? IndexOptionsValue { get; set; } + private DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } + private Action IndexOptionsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + + public DenseVectorPropertyDescriptor Dims(int dims) + { + DimsValue = dims; + return Self; + } + + public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DenseVectorPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? indexOptions) + { + IndexOptionsDescriptor = null; + IndexOptionsDescriptorAction = null; + IndexOptionsValue = indexOptions; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + { + IndexOptionsValue = null; + IndexOptionsDescriptorAction = null; + IndexOptionsDescriptor = descriptor; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(Action configure) + { + IndexOptionsValue = null; + IndexOptionsDescriptor = null; + IndexOptionsDescriptorAction = configure; + return Self; + } + + public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsDescriptor is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsDescriptor, options); + } + else if (IndexOptionsDescriptorAction is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + } + else if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("dense_vector"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? BuildIndexOptions() + { + if (IndexOptionsValue is not null) + { + return IndexOptionsValue; + } + + if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexOptionsDescriptorAction is not null) + { + var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DenseVectorProperty IBuildableDescriptor.Build() => new() + { + Dims = DimsValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = BuildIndexOptions(), + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue + }; +} + +public sealed partial class DenseVectorPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DenseVectorPropertyDescriptor(Action configure) => configure.Invoke(this); + + public DenseVectorPropertyDescriptor() : base() + { + } + + private int DimsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? IndexOptionsValue { get; set; } + private DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } + private Action IndexOptionsDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + + public DenseVectorPropertyDescriptor Dims(int dims) + { + DimsValue = dims; + return Self; + } + + public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DenseVectorPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? indexOptions) + { + IndexOptionsDescriptor = null; + IndexOptionsDescriptorAction = null; + IndexOptionsValue = indexOptions; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + { + IndexOptionsValue = null; + IndexOptionsDescriptorAction = null; + IndexOptionsDescriptor = descriptor; + return Self; + } + + public DenseVectorPropertyDescriptor IndexOptions(Action configure) + { + IndexOptionsValue = null; + IndexOptionsDescriptor = null; + IndexOptionsDescriptorAction = configure; + return Self; + } + + public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DenseVectorPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsDescriptor is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsDescriptor, options); + } + else if (IndexOptionsDescriptorAction is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + } + else if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("dense_vector"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? BuildIndexOptions() + { + if (IndexOptionsValue is not null) + { + return IndexOptionsValue; + } + + if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexOptionsDescriptorAction is not null) + { + var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DenseVectorProperty IBuildableDescriptor.Build() => new() + { + Dims = DimsValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = BuildIndexOptions(), + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs new file mode 100644 index 00000000000..063642f518f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DoubleNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public double? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "double"; +} + +public sealed partial class DoubleNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DoubleNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DoubleNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public DoubleNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DoubleNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DoubleNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DoubleNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DoubleNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DoubleNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DoubleNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public DoubleNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DoubleNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("double"); + writer.WriteEndObject(); + } + + DoubleNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class DoubleNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DoubleNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public DoubleNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public DoubleNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DoubleNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DoubleNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DoubleNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DoubleNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DoubleNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DoubleNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public DoubleNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DoubleNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("double"); + writer.WriteEndObject(); + } + + DoubleNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs new file mode 100644 index 00000000000..47a2d1b347d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DoubleRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "double_range"; +} + +public sealed partial class DoubleRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DoubleRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DoubleRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DoubleRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DoubleRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DoubleRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DoubleRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DoubleRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DoubleRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DoubleRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("double_range"); + writer.WriteEndObject(); + } + + DoubleRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class DoubleRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DoubleRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public DoubleRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public DoubleRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DoubleRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DoubleRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DoubleRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DoubleRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DoubleRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DoubleRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DoubleRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("double_range"); + writer.WriteEndObject(); + } + + DoubleRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs new file mode 100644 index 00000000000..2632193552a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs @@ -0,0 +1,1173 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DynamicProperty : IProperty +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("index_phrases")] + public bool? IndexPhrases { get; set; } + [JsonInclude, JsonPropertyName("index_prefixes")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } + [JsonInclude, JsonPropertyName("locale")] + public string? Locale { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("norms")] + public bool? Norms { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("position_increment_gap")] + public int? PositionIncrementGap { get; set; } + [JsonInclude, JsonPropertyName("precision_step")] + public int? PrecisionStep { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("search_analyzer")] + public string? SearchAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("search_quote_analyzer")] + public string? SearchQuoteAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("term_vector")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVector { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "{dynamic_property}"; +} + +public sealed partial class DynamicPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal DynamicPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public DynamicPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private bool? IndexPhrasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } + private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } + private string? LocaleValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private int? PositionIncrementGapValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public DynamicPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public DynamicPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DynamicPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DynamicPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DynamicPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DynamicPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DynamicPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public DynamicPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DynamicPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DynamicPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DynamicPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DynamicPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public DynamicPropertyDescriptor IndexPhrases(bool? indexPhrases = true) + { + IndexPhrasesValue = indexPhrases; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? indexPrefixes) + { + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesValue = indexPrefixes; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesDescriptor = descriptor; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(Action configure) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = configure; + return Self; + } + + public DynamicPropertyDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DynamicPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public DynamicPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.Serverless.FieldValue? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DynamicPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public DynamicPropertyDescriptor PositionIncrementGap(int? positionIncrementGap) + { + PositionIncrementGapValue = positionIncrementGap; + return Self; + } + + public DynamicPropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public DynamicPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public DynamicPropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public DynamicPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DynamicPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public DynamicPropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + public DynamicPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (IndexPhrasesValue.HasValue) + { + writer.WritePropertyName("index_phrases"); + writer.WriteBooleanValue(IndexPhrasesValue.Value); + } + + if (IndexPrefixesDescriptor is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesDescriptor, options); + } + else if (IndexPrefixesDescriptorAction is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + } + else if (IndexPrefixesValue is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesValue, options); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PositionIncrementGapValue.HasValue) + { + writer.WritePropertyName("position_increment_gap"); + writer.WriteNumberValue(PositionIncrementGapValue.Value); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("{dynamic_property}"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? BuildIndexPrefixes() + { + if (IndexPrefixesValue is not null) + { + return IndexPrefixesValue; + } + + if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexPrefixesDescriptorAction is not null) + { + var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DynamicProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Enabled = EnabledValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + IndexPhrases = IndexPhrasesValue, + IndexPrefixes = BuildIndexPrefixes(), + Locale = LocaleValue, + Meta = MetaValue, + Norms = NormsValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + PositionIncrementGap = PositionIncrementGapValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Script = ScriptValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class DynamicPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal DynamicPropertyDescriptor(Action configure) => configure.Invoke(this); + + public DynamicPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private string? FormatValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private bool? IndexPhrasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } + private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } + private string? LocaleValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private int? PositionIncrementGapValue { get; set; } + private int? PrecisionStepValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public DynamicPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public DynamicPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public DynamicPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public DynamicPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public DynamicPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public DynamicPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public DynamicPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public DynamicPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DynamicPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public DynamicPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public DynamicPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public DynamicPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public DynamicPropertyDescriptor IndexPhrases(bool? indexPhrases = true) + { + IndexPhrasesValue = indexPhrases; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? indexPrefixes) + { + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesValue = indexPrefixes; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesDescriptor = descriptor; + return Self; + } + + public DynamicPropertyDescriptor IndexPrefixes(Action configure) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = configure; + return Self; + } + + public DynamicPropertyDescriptor Locale(string? locale) + { + LocaleValue = locale; + return Self; + } + + public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public DynamicPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public DynamicPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.Serverless.FieldValue? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public DynamicPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public DynamicPropertyDescriptor PositionIncrementGap(int? positionIncrementGap) + { + PositionIncrementGapValue = positionIncrementGap; + return Self; + } + + public DynamicPropertyDescriptor PrecisionStep(int? precisionStep) + { + PrecisionStepValue = precisionStep; + return Self; + } + + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public DynamicPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public DynamicPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public DynamicPropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public DynamicPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public DynamicPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public DynamicPropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + public DynamicPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (IndexPhrasesValue.HasValue) + { + writer.WritePropertyName("index_phrases"); + writer.WriteBooleanValue(IndexPhrasesValue.Value); + } + + if (IndexPrefixesDescriptor is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesDescriptor, options); + } + else if (IndexPrefixesDescriptorAction is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + } + else if (IndexPrefixesValue is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesValue, options); + } + + if (!string.IsNullOrEmpty(LocaleValue)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(LocaleValue); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PositionIncrementGapValue.HasValue) + { + writer.WritePropertyName("position_increment_gap"); + writer.WriteNumberValue(PositionIncrementGapValue.Value); + } + + if (PrecisionStepValue.HasValue) + { + writer.WritePropertyName("precision_step"); + writer.WriteNumberValue(PrecisionStepValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("{dynamic_property}"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? BuildIndexPrefixes() + { + if (IndexPrefixesValue is not null) + { + return IndexPrefixesValue; + } + + if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexPrefixesDescriptorAction is not null) + { + var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + DynamicProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Enabled = EnabledValue, + Fields = FieldsValue, + Format = FormatValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + IndexPhrases = IndexPhrasesValue, + IndexPrefixes = BuildIndexPrefixes(), + Locale = LocaleValue, + Meta = MetaValue, + Norms = NormsValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + PositionIncrementGap = PositionIncrementGapValue, + PrecisionStep = PrecisionStepValue, + Properties = PropertiesValue, + Script = ScriptValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs new file mode 100644 index 00000000000..d38fb7fba9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class DynamicTemplate +{ + [JsonInclude, JsonPropertyName("mapping")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IProperty? Mapping { get; set; } + [JsonInclude, JsonPropertyName("match")] + public string? Match { get; set; } + [JsonInclude, JsonPropertyName("match_mapping_type")] + public string? MatchMappingType { get; set; } + [JsonInclude, JsonPropertyName("match_pattern")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.MatchType? MatchPattern { get; set; } + [JsonInclude, JsonPropertyName("path_match")] + public string? PathMatch { get; set; } + [JsonInclude, JsonPropertyName("path_unmatch")] + public string? PathUnmatch { get; set; } + [JsonInclude, JsonPropertyName("unmatch")] + public string? Unmatch { get; set; } +} + +public sealed partial class DynamicTemplateDescriptor : SerializableDescriptor +{ + internal DynamicTemplateDescriptor(Action configure) => configure.Invoke(this); + + public DynamicTemplateDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IProperty? MappingValue { get; set; } + private string? MatchValue { get; set; } + private string? MatchMappingTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.MatchType? MatchPatternValue { get; set; } + private string? PathMatchValue { get; set; } + private string? PathUnmatchValue { get; set; } + private string? UnmatchValue { get; set; } + + public DynamicTemplateDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless.Mapping.IProperty? mapping) + { + MappingValue = mapping; + return Self; + } + + public DynamicTemplateDescriptor Match(string? match) + { + MatchValue = match; + return Self; + } + + public DynamicTemplateDescriptor MatchMappingType(string? matchMappingType) + { + MatchMappingTypeValue = matchMappingType; + return Self; + } + + public DynamicTemplateDescriptor MatchPattern(Elastic.Clients.Elasticsearch.Serverless.Mapping.MatchType? matchPattern) + { + MatchPatternValue = matchPattern; + return Self; + } + + public DynamicTemplateDescriptor PathMatch(string? pathMatch) + { + PathMatchValue = pathMatch; + return Self; + } + + public DynamicTemplateDescriptor PathUnmatch(string? pathUnmatch) + { + PathUnmatchValue = pathUnmatch; + return Self; + } + + public DynamicTemplateDescriptor Unmatch(string? unmatch) + { + UnmatchValue = unmatch; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MappingValue is not null) + { + writer.WritePropertyName("mapping"); + JsonSerializer.Serialize(writer, MappingValue, options); + } + + if (!string.IsNullOrEmpty(MatchValue)) + { + writer.WritePropertyName("match"); + writer.WriteStringValue(MatchValue); + } + + if (!string.IsNullOrEmpty(MatchMappingTypeValue)) + { + writer.WritePropertyName("match_mapping_type"); + writer.WriteStringValue(MatchMappingTypeValue); + } + + if (MatchPatternValue is not null) + { + writer.WritePropertyName("match_pattern"); + JsonSerializer.Serialize(writer, MatchPatternValue, options); + } + + if (!string.IsNullOrEmpty(PathMatchValue)) + { + writer.WritePropertyName("path_match"); + writer.WriteStringValue(PathMatchValue); + } + + if (!string.IsNullOrEmpty(PathUnmatchValue)) + { + writer.WritePropertyName("path_unmatch"); + writer.WriteStringValue(PathUnmatchValue); + } + + if (!string.IsNullOrEmpty(UnmatchValue)) + { + writer.WritePropertyName("unmatch"); + writer.WriteStringValue(UnmatchValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs new file mode 100644 index 00000000000..9ed373b6c59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs @@ -0,0 +1,333 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class FieldAliasProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "alias"; +} + +public sealed partial class FieldAliasPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal FieldAliasPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public FieldAliasPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public FieldAliasPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FieldAliasPropertyDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + public FieldAliasPropertyDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("alias"); + writer.WriteEndObject(); + } + + FieldAliasProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Path = PathValue, + Properties = PropertiesValue + }; +} + +public sealed partial class FieldAliasPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FieldAliasPropertyDescriptor(Action configure) => configure.Invoke(this); + + public FieldAliasPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public FieldAliasPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FieldAliasPropertyDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + public FieldAliasPropertyDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public FieldAliasPropertyDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FieldAliasPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("alias"); + writer.WriteEndObject(); + } + + FieldAliasProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Path = PathValue, + Properties = PropertiesValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldNamesField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldNamesField.g.cs new file mode 100644 index 00000000000..68f126f1dd7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldNamesField.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class FieldNamesField +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class FieldNamesFieldDescriptor : SerializableDescriptor +{ + internal FieldNamesFieldDescriptor(Action configure) => configure.Invoke(this); + + public FieldNamesFieldDescriptor() : base() + { + } + + private bool EnabledValue { get; set; } + + public FieldNamesFieldDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs new file mode 100644 index 00000000000..3ec756cc17f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs @@ -0,0 +1,555 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class FlattenedProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("depth_limit")] + public int? DepthLimit { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public string? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("split_queries_on_whitespace")] + public bool? SplitQueriesOnWhitespace { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "flattened"; +} + +public sealed partial class FlattenedPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal FlattenedPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public FlattenedPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private int? DepthLimitValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? SplitQueriesOnWhitespaceValue { get; set; } + + public FlattenedPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FlattenedPropertyDescriptor DepthLimit(int? depthLimit) + { + DepthLimitValue = depthLimit; + return Self; + } + + public FlattenedPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FlattenedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FlattenedPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FlattenedPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FlattenedPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FlattenedPropertyDescriptor SplitQueriesOnWhitespace(bool? splitQueriesOnWhitespace = true) + { + SplitQueriesOnWhitespaceValue = splitQueriesOnWhitespace; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DepthLimitValue.HasValue) + { + writer.WritePropertyName("depth_limit"); + writer.WriteNumberValue(DepthLimitValue.Value); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (SplitQueriesOnWhitespaceValue.HasValue) + { + writer.WritePropertyName("split_queries_on_whitespace"); + writer.WriteBooleanValue(SplitQueriesOnWhitespaceValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("flattened"); + writer.WriteEndObject(); + } + + FlattenedProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + DepthLimit = DepthLimitValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue + }; +} + +public sealed partial class FlattenedPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FlattenedPropertyDescriptor(Action configure) => configure.Invoke(this); + + public FlattenedPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private int? DepthLimitValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? SplitQueriesOnWhitespaceValue { get; set; } + + public FlattenedPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FlattenedPropertyDescriptor DepthLimit(int? depthLimit) + { + DepthLimitValue = depthLimit; + return Self; + } + + public FlattenedPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FlattenedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FlattenedPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FlattenedPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FlattenedPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FlattenedPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FlattenedPropertyDescriptor SplitQueriesOnWhitespace(bool? splitQueriesOnWhitespace = true) + { + SplitQueriesOnWhitespaceValue = splitQueriesOnWhitespace; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DepthLimitValue.HasValue) + { + writer.WritePropertyName("depth_limit"); + writer.WriteNumberValue(DepthLimitValue.Value); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (SplitQueriesOnWhitespaceValue.HasValue) + { + writer.WritePropertyName("split_queries_on_whitespace"); + writer.WriteBooleanValue(SplitQueriesOnWhitespaceValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("flattened"); + writer.WriteEndObject(); + } + + FlattenedProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + DepthLimit = DepthLimitValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs new file mode 100644 index 00000000000..88ba3102e35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class FloatNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public float? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "float"; +} + +public sealed partial class FloatNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal FloatNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public FloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private float? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public FloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public FloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public FloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FloatNumberPropertyDescriptor NullValue(float? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public FloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public FloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("float"); + writer.WriteEndObject(); + } + + FloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class FloatNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FloatNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public FloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private float? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public FloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public FloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public FloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FloatNumberPropertyDescriptor NullValue(float? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public FloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public FloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("float"); + writer.WriteEndObject(); + } + + FloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs new file mode 100644 index 00000000000..fac08d51ffe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class FloatRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "float_range"; +} + +public sealed partial class FloatRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal FloatRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public FloatRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public FloatRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FloatRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public FloatRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public FloatRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FloatRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FloatRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FloatRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("float_range"); + writer.WriteEndObject(); + } + + FloatRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class FloatRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal FloatRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public FloatRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public FloatRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public FloatRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public FloatRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public FloatRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public FloatRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public FloatRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public FloatRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public FloatRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("float_range"); + writer.WriteEndObject(); + } + + FloatRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs new file mode 100644 index 00000000000..6a0fb49c287 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class GeoPointProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("ignore_z_value")] + public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "geo_point"; +} + +public sealed partial class GeoPointPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal GeoPointPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public GeoPointPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public GeoPointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public GeoPointPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public GeoPointPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public GeoPointPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("geo_point"); + writer.WriteEndObject(); + } + + GeoPointProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class GeoPointPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal GeoPointPropertyDescriptor(Action configure) => configure.Invoke(this); + + public GeoPointPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public GeoPointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public GeoPointPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public GeoPointPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoPointPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public GeoPointPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("geo_point"); + writer.WriteEndObject(); + } + + GeoPointProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs new file mode 100644 index 00000000000..f3f9a2f509f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs @@ -0,0 +1,564 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +/// +/// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+///
+public sealed partial class GeoShapeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("ignore_z_value")] + public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("orientation")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? Orientation { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("strategy")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoStrategy? Strategy { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "geo_shape"; +} + +/// +/// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+///
+public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal GeoShapePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public GeoShapePropertyDescriptor() : base() + { + } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? OrientationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoStrategy? StrategyValue { get; set; } + + public GeoShapePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public GeoShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public GeoShapePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public GeoShapePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoShapePropertyDescriptor Orientation(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? orientation) + { + OrientationValue = orientation; + return Self; + } + + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public GeoShapePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public GeoShapePropertyDescriptor Strategy(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoStrategy? strategy) + { + StrategyValue = strategy; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (OrientationValue is not null) + { + writer.WritePropertyName("orientation"); + JsonSerializer.Serialize(writer, OrientationValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (StrategyValue is not null) + { + writer.WritePropertyName("strategy"); + JsonSerializer.Serialize(writer, StrategyValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("geo_shape"); + writer.WriteEndObject(); + } + + GeoShapeProperty IBuildableDescriptor.Build() => new() + { + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + Orientation = OrientationValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue, + Strategy = StrategyValue + }; +} + +/// +/// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+///
+public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal GeoShapePropertyDescriptor(Action configure) => configure.Invoke(this); + + public GeoShapePropertyDescriptor() : base() + { + } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? OrientationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoStrategy? StrategyValue { get; set; } + + public GeoShapePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public GeoShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public GeoShapePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public GeoShapePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public GeoShapePropertyDescriptor Orientation(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? orientation) + { + OrientationValue = orientation; + return Self; + } + + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public GeoShapePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public GeoShapePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public GeoShapePropertyDescriptor Strategy(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoStrategy? strategy) + { + StrategyValue = strategy; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (OrientationValue is not null) + { + writer.WritePropertyName("orientation"); + JsonSerializer.Serialize(writer, OrientationValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (StrategyValue is not null) + { + writer.WritePropertyName("strategy"); + JsonSerializer.Serialize(writer, StrategyValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("geo_shape"); + writer.WriteEndObject(); + } + + GeoShapeProperty IBuildableDescriptor.Build() => new() + { + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + Orientation = OrientationValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue, + Strategy = StrategyValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs new file mode 100644 index 00000000000..dcccf71f444 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class HalfFloatNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public float? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "half_float"; +} + +public sealed partial class HalfFloatNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal HalfFloatNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public HalfFloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private float? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public HalfFloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public HalfFloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public HalfFloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HalfFloatNumberPropertyDescriptor NullValue(float? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("half_float"); + writer.WriteEndObject(); + } + + HalfFloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class HalfFloatNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal HalfFloatNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public HalfFloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private float? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public HalfFloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public HalfFloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public HalfFloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HalfFloatNumberPropertyDescriptor NullValue(float? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public HalfFloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("half_float"); + writer.WriteEndObject(); + } + + HalfFloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs new file mode 100644 index 00000000000..0022358f4a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs @@ -0,0 +1,315 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class HistogramProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "histogram"; +} + +public sealed partial class HistogramPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal HistogramPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public HistogramPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public HistogramPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("histogram"); + writer.WriteEndObject(); + } + + HistogramProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} + +public sealed partial class HistogramPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal HistogramPropertyDescriptor(Action configure) => configure.Invoke(this); + + public HistogramPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public HistogramPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public HistogramPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("histogram"); + writer.WriteEndObject(); + } + + HistogramProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IndexField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IndexField.g.cs new file mode 100644 index 00000000000..1761195b7f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IndexField.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class IndexField +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class IndexFieldDescriptor : SerializableDescriptor +{ + internal IndexFieldDescriptor(Action configure) => configure.Invoke(this); + + public IndexFieldDescriptor() : base() + { + } + + private bool EnabledValue { get; set; } + + public IndexFieldDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs new file mode 100644 index 00000000000..65f0e28a448 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class IntegerNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public int? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "integer"; +} + +public sealed partial class IntegerNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal IntegerNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public IntegerNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public IntegerNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IntegerNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IntegerNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IntegerNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public IntegerNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IntegerNumberPropertyDescriptor NullValue(int? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public IntegerNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public IntegerNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IntegerNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("integer"); + writer.WriteEndObject(); + } + + IntegerNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class IntegerNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IntegerNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public IntegerNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public IntegerNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IntegerNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IntegerNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IntegerNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public IntegerNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IntegerNumberPropertyDescriptor NullValue(int? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public IntegerNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public IntegerNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IntegerNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("integer"); + writer.WriteEndObject(); + } + + IntegerNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs new file mode 100644 index 00000000000..043e27db4fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class IntegerRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "integer_range"; +} + +public sealed partial class IntegerRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal IntegerRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public IntegerRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public IntegerRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IntegerRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IntegerRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IntegerRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IntegerRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IntegerRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IntegerRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("integer_range"); + writer.WriteEndObject(); + } + + IntegerRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class IntegerRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IntegerRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public IntegerRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public IntegerRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IntegerRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IntegerRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IntegerRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IntegerRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IntegerRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IntegerRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IntegerRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("integer_range"); + writer.WriteEndObject(); + } + + IntegerRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs new file mode 100644 index 00000000000..af672be85df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs @@ -0,0 +1,625 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class IpProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public string? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "ip"; +} + +public sealed partial class IpPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal IpPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public IpPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + + public IpPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IpPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IpPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IpPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IpPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public IpPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IpPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public IpPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public IpPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IpPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + public IpPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("ip"); + writer.WriteEndObject(); + } + + IpProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue + }; +} + +public sealed partial class IpPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IpPropertyDescriptor(Action configure) => configure.Invoke(this); + + public IpPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + + public IpPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IpPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IpPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IpPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IpPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public IpPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IpPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public IpPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public IpPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IpPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + public IpPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("ip"); + writer.WriteEndObject(); + } + + IpProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs new file mode 100644 index 00000000000..f6925f31e42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class IpRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "ip_range"; +} + +public sealed partial class IpRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal IpRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public IpRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public IpRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IpRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IpRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IpRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IpRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IpRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IpRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("ip_range"); + writer.WriteEndObject(); + } + + IpRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class IpRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal IpRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public IpRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public IpRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public IpRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public IpRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public IpRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public IpRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public IpRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public IpRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public IpRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("ip_range"); + writer.WriteEndObject(); + } + + IpRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs new file mode 100644 index 00000000000..c758fc41134 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs @@ -0,0 +1,345 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class JoinProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("relations")] + public IDictionary>? Relations { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "join"; +} + +public sealed partial class JoinPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal JoinPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public JoinPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary>? RelationsValue { get; set; } + + public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public JoinPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + { + RelationsValue = selector?.Invoke(new FluentDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RelationsValue is not null) + { + writer.WritePropertyName("relations"); + JsonSerializer.Serialize(writer, RelationsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("join"); + writer.WriteEndObject(); + } + + JoinProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Relations = RelationsValue + }; +} + +public sealed partial class JoinPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal JoinPropertyDescriptor(Action configure) => configure.Invoke(this); + + public JoinPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary>? RelationsValue { get; set; } + + public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public JoinPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + { + RelationsValue = selector?.Invoke(new FluentDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RelationsValue is not null) + { + writer.WritePropertyName("relations"); + JsonSerializer.Serialize(writer, RelationsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("join"); + writer.WriteEndObject(); + } + + JoinProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Relations = RelationsValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs new file mode 100644 index 00000000000..b8dccab9f6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs @@ -0,0 +1,685 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class KeywordProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("normalizer")] + public string? Normalizer { get; set; } + [JsonInclude, JsonPropertyName("norms")] + public bool? Norms { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public string? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("split_queries_on_whitespace")] + public bool? SplitQueriesOnWhitespace { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "keyword"; +} + +public sealed partial class KeywordPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal KeywordPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public KeywordPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NormalizerValue { get; set; } + private bool? NormsValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? SplitQueriesOnWhitespaceValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + + public KeywordPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public KeywordPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public KeywordPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public KeywordPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public KeywordPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public KeywordPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public KeywordPropertyDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + public KeywordPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public KeywordPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public KeywordPropertyDescriptor SplitQueriesOnWhitespace(bool? splitQueriesOnWhitespace = true) + { + SplitQueriesOnWhitespaceValue = splitQueriesOnWhitespace; + return Self; + } + + public KeywordPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + public KeywordPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (SplitQueriesOnWhitespaceValue.HasValue) + { + writer.WritePropertyName("split_queries_on_whitespace"); + writer.WriteBooleanValue(SplitQueriesOnWhitespaceValue.Value); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("keyword"); + writer.WriteEndObject(); + } + + KeywordProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + Meta = MetaValue, + Normalizer = NormalizerValue, + Norms = NormsValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue + }; +} + +public sealed partial class KeywordPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal KeywordPropertyDescriptor(Action configure) => configure.Invoke(this); + + public KeywordPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NormalizerValue { get; set; } + private bool? NormsValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? SplitQueriesOnWhitespaceValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + + public KeywordPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public KeywordPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public KeywordPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public KeywordPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public KeywordPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public KeywordPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public KeywordPropertyDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + public KeywordPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public KeywordPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public KeywordPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public KeywordPropertyDescriptor SplitQueriesOnWhitespace(bool? splitQueriesOnWhitespace = true) + { + SplitQueriesOnWhitespaceValue = splitQueriesOnWhitespace; + return Self; + } + + public KeywordPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// + public KeywordPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (SplitQueriesOnWhitespaceValue.HasValue) + { + writer.WritePropertyName("split_queries_on_whitespace"); + writer.WriteBooleanValue(SplitQueriesOnWhitespaceValue.Value); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("keyword"); + writer.WriteEndObject(); + } + + KeywordProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + Meta = MetaValue, + Normalizer = NormalizerValue, + Norms = NormsValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs new file mode 100644 index 00000000000..1000f628f71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class LongNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public long? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "long"; +} + +public sealed partial class LongNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal LongNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public LongNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public LongNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public LongNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public LongNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public LongNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public LongNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public LongNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LongNumberPropertyDescriptor NullValue(long? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public LongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public LongNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public LongNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("long"); + writer.WriteEndObject(); + } + + LongNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class LongNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LongNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public LongNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public LongNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public LongNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public LongNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public LongNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public LongNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public LongNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LongNumberPropertyDescriptor NullValue(long? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public LongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public LongNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public LongNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("long"); + writer.WriteEndObject(); + } + + LongNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs new file mode 100644 index 00000000000..24d8b988ab9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class LongRangeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "long_range"; +} + +public sealed partial class LongRangePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal LongRangePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public LongRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public LongRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public LongRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public LongRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public LongRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public LongRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public LongRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public LongRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("long_range"); + writer.WriteEndObject(); + } + + LongRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class LongRangePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal LongRangePropertyDescriptor(Action configure) => configure.Invoke(this); + + public LongRangePropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public LongRangePropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public LongRangePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public LongRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public LongRangePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public LongRangePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public LongRangePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public LongRangePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public LongRangePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("long_range"); + writer.WriteEndObject(); + } + + LongRangeProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs new file mode 100644 index 00000000000..0b0b1f7d36e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs @@ -0,0 +1,247 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +/// +/// A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field
effectively stores data the same way as a text field that only indexes documents (index_options: docs) and
disables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries
that need positions such as the match_phrase query perform slower as they need to look at the _source document
to verify whether a phrase matches. All queries return constant scores that are equal to 1.0.
+///
+public sealed partial class MatchOnlyTextProperty : IProperty +{ + /// + /// Allows you to copy the values of multiple fields into a group
field, which can then be queried as a single field.
+ ///
+ [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + + /// + /// Metadata about the field. + /// + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "match_only_text"; +} + +/// +/// A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field
effectively stores data the same way as a text field that only indexes documents (index_options: docs) and
disables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries
that need positions such as the match_phrase query perform slower as they need to look at the _source document
to verify whether a phrase matches. All queries return constant scores that are equal to 1.0.
+///
+public sealed partial class MatchOnlyTextPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal MatchOnlyTextPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public MatchOnlyTextPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Allows you to copy the values of multiple fields into a group
field, which can then be queried as a single field.
+ ///
+ public MatchOnlyTextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Metadata about the field. + /// + public MatchOnlyTextPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("match_only_text"); + writer.WriteEndObject(); + } + + MatchOnlyTextProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Fields = FieldsValue, + Meta = MetaValue + }; +} + +/// +/// A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field
effectively stores data the same way as a text field that only indexes documents (index_options: docs) and
disables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries
that need positions such as the match_phrase query perform slower as they need to look at the _source document
to verify whether a phrase matches. All queries return constant scores that are equal to 1.0.
+///
+public sealed partial class MatchOnlyTextPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal MatchOnlyTextPropertyDescriptor(Action configure) => configure.Invoke(this); + + public MatchOnlyTextPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Allows you to copy the values of multiple fields into a group
field, which can then be queried as a single field.
+ ///
+ public MatchOnlyTextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one
field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
+ ///
+ public MatchOnlyTextPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + /// + /// Metadata about the field. + /// + public MatchOnlyTextPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("match_only_text"); + writer.WriteEndObject(); + } + + MatchOnlyTextProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Fields = FieldsValue, + Meta = MetaValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs new file mode 100644 index 00000000000..86adba7ef29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs @@ -0,0 +1,405 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class Murmur3HashProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "murmur3"; +} + +public sealed partial class Murmur3HashPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal Murmur3HashPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public Murmur3HashPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public Murmur3HashPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public Murmur3HashPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public Murmur3HashPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public Murmur3HashPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("murmur3"); + writer.WriteEndObject(); + } + + Murmur3HashProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class Murmur3HashPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal Murmur3HashPropertyDescriptor(Action configure) => configure.Invoke(this); + + public Murmur3HashPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public Murmur3HashPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public Murmur3HashPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public Murmur3HashPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public Murmur3HashPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public Murmur3HashPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("murmur3"); + writer.WriteEndObject(); + } + + Murmur3HashProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs new file mode 100644 index 00000000000..8f67f2bb4c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs @@ -0,0 +1,465 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class NestedProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("include_in_parent")] + public bool? IncludeInParent { get; set; } + [JsonInclude, JsonPropertyName("include_in_root")] + public bool? IncludeInRoot { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "nested"; +} + +public sealed partial class NestedPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal NestedPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public NestedPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IncludeInParentValue { get; set; } + private bool? IncludeInRootValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public NestedPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public NestedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public NestedPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public NestedPropertyDescriptor IncludeInParent(bool? includeInParent = true) + { + IncludeInParentValue = includeInParent; + return Self; + } + + public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = true) + { + IncludeInRootValue = includeInRoot; + return Self; + } + + public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public NestedPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IncludeInParentValue.HasValue) + { + writer.WritePropertyName("include_in_parent"); + writer.WriteBooleanValue(IncludeInParentValue.Value); + } + + if (IncludeInRootValue.HasValue) + { + writer.WritePropertyName("include_in_root"); + writer.WriteBooleanValue(IncludeInRootValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("nested"); + writer.WriteEndObject(); + } + + NestedProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Enabled = EnabledValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IncludeInParent = IncludeInParentValue, + IncludeInRoot = IncludeInRootValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class NestedPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal NestedPropertyDescriptor(Action configure) => configure.Invoke(this); + + public NestedPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IncludeInParentValue { get; set; } + private bool? IncludeInRootValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public NestedPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public NestedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public NestedPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public NestedPropertyDescriptor IncludeInParent(bool? includeInParent = true) + { + IncludeInParentValue = includeInParent; + return Self; + } + + public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = true) + { + IncludeInRootValue = includeInRoot; + return Self; + } + + public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public NestedPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public NestedPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IncludeInParentValue.HasValue) + { + writer.WritePropertyName("include_in_parent"); + writer.WriteBooleanValue(IncludeInParentValue.Value); + } + + if (IncludeInRootValue.HasValue) + { + writer.WritePropertyName("include_in_root"); + writer.WriteBooleanValue(IncludeInRootValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("nested"); + writer.WriteEndObject(); + } + + NestedProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Enabled = EnabledValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IncludeInParent = IncludeInParentValue, + IncludeInRoot = IncludeInRootValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs new file mode 100644 index 00000000000..bc0da77620f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs @@ -0,0 +1,405 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class ObjectProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "object"; +} + +public sealed partial class ObjectPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ObjectPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ObjectPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public ObjectPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ObjectPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ObjectPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ObjectPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("object"); + writer.WriteEndObject(); + } + + ObjectProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Enabled = EnabledValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class ObjectPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ObjectPropertyDescriptor(Action configure) => configure.Invoke(this); + + public ObjectPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public ObjectPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ObjectPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ObjectPropertyDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ObjectPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ObjectPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("object"); + writer.WriteEndObject(); + } + + ObjectProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Enabled = EnabledValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs new file mode 100644 index 00000000000..eed264aa85e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs @@ -0,0 +1,285 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class PercolatorProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "percolator"; +} + +public sealed partial class PercolatorPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal PercolatorPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public PercolatorPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public PercolatorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("percolator"); + writer.WriteEndObject(); + } + + PercolatorProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} + +public sealed partial class PercolatorPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PercolatorPropertyDescriptor(Action configure) => configure.Invoke(this); + + public PercolatorPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public PercolatorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PercolatorPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("percolator"); + writer.WriteEndObject(); + } + + PercolatorProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs new file mode 100644 index 00000000000..c0ade3b8e8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs @@ -0,0 +1,495 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class PointProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("ignore_z_value")] + public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public string? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "point"; +} + +public sealed partial class PointPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal PointPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public PointPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public PointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public PointPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public PointPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public PointPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PointPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public PointPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("point"); + writer.WriteEndObject(); + } + + PointProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class PointPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal PointPropertyDescriptor(Action configure) => configure.Invoke(this); + + public PointPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public PointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public PointPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public PointPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public PointPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public PointPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public PointPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public PointPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("point"); + writer.WriteEndObject(); + } + + PointProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs new file mode 100644 index 00000000000..ea370755c62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs @@ -0,0 +1,575 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public partial class Properties : IsADictionary +{ + public Properties() + { + } + + public Properties(IDictionary container) : base(container) + { + } + + public void Add(PropertyName propertyName, IProperty property) => BackingDictionary.Add(Sanitize(propertyName), property); + public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValue: true)] out IProperty property) => BackingDictionary.TryGetValue(Sanitize(propertyName), out property); + + public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValue: true)] out T? property) where T : class, IProperty + { + if (BackingDictionary.TryGetValue(Sanitize(propertyName), out var matchedValue) && matchedValue is T finalValue) + { + property = finalValue; + return true; + } + + property = null; + return false; + } +} + +public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, PropertyName, IProperty> +{ + public PropertiesDescriptor() : base(new Properties()) + { + } + + public PropertiesDescriptor(Properties properties) : base(properties ?? new Properties()) + { + } + + public PropertiesDescriptor AggregateMetricDouble(PropertyName propertyName) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, null); + public PropertiesDescriptor AggregateMetricDouble(PropertyName propertyName, Action> configure) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, configure); + public PropertiesDescriptor AggregateMetricDouble(PropertyName propertyName, AggregateMetricDoubleProperty aggregateMetricDoubleProperty) => AssignVariant(propertyName, aggregateMetricDoubleProperty); + public PropertiesDescriptor AggregateMetricDouble(Expression> propertyName) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, null); + public PropertiesDescriptor AggregateMetricDouble(Expression> propertyName, Action> configure) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, configure); + public PropertiesDescriptor Binary(PropertyName propertyName) => AssignVariant, BinaryProperty>(propertyName, null); + public PropertiesDescriptor Binary(PropertyName propertyName, Action> configure) => AssignVariant, BinaryProperty>(propertyName, configure); + public PropertiesDescriptor Binary(PropertyName propertyName, BinaryProperty binaryProperty) => AssignVariant(propertyName, binaryProperty); + public PropertiesDescriptor Binary(Expression> propertyName) => AssignVariant, BinaryProperty>(propertyName, null); + public PropertiesDescriptor Binary(Expression> propertyName, Action> configure) => AssignVariant, BinaryProperty>(propertyName, configure); + public PropertiesDescriptor Boolean(PropertyName propertyName) => AssignVariant, BooleanProperty>(propertyName, null); + public PropertiesDescriptor Boolean(PropertyName propertyName, Action> configure) => AssignVariant, BooleanProperty>(propertyName, configure); + public PropertiesDescriptor Boolean(PropertyName propertyName, BooleanProperty booleanProperty) => AssignVariant(propertyName, booleanProperty); + public PropertiesDescriptor Boolean(Expression> propertyName) => AssignVariant, BooleanProperty>(propertyName, null); + public PropertiesDescriptor Boolean(Expression> propertyName, Action> configure) => AssignVariant, BooleanProperty>(propertyName, configure); + public PropertiesDescriptor ByteNumber(PropertyName propertyName) => AssignVariant, ByteNumberProperty>(propertyName, null); + public PropertiesDescriptor ByteNumber(PropertyName propertyName, Action> configure) => AssignVariant, ByteNumberProperty>(propertyName, configure); + public PropertiesDescriptor ByteNumber(PropertyName propertyName, ByteNumberProperty byteNumberProperty) => AssignVariant(propertyName, byteNumberProperty); + public PropertiesDescriptor ByteNumber(Expression> propertyName) => AssignVariant, ByteNumberProperty>(propertyName, null); + public PropertiesDescriptor ByteNumber(Expression> propertyName, Action> configure) => AssignVariant, ByteNumberProperty>(propertyName, configure); + public PropertiesDescriptor Completion(PropertyName propertyName) => AssignVariant, CompletionProperty>(propertyName, null); + public PropertiesDescriptor Completion(PropertyName propertyName, Action> configure) => AssignVariant, CompletionProperty>(propertyName, configure); + public PropertiesDescriptor Completion(PropertyName propertyName, CompletionProperty completionProperty) => AssignVariant(propertyName, completionProperty); + public PropertiesDescriptor Completion(Expression> propertyName) => AssignVariant, CompletionProperty>(propertyName, null); + public PropertiesDescriptor Completion(Expression> propertyName, Action> configure) => AssignVariant, CompletionProperty>(propertyName, configure); + public PropertiesDescriptor ConstantKeyword(PropertyName propertyName) => AssignVariant, ConstantKeywordProperty>(propertyName, null); + public PropertiesDescriptor ConstantKeyword(PropertyName propertyName, Action> configure) => AssignVariant, ConstantKeywordProperty>(propertyName, configure); + public PropertiesDescriptor ConstantKeyword(PropertyName propertyName, ConstantKeywordProperty constantKeywordProperty) => AssignVariant(propertyName, constantKeywordProperty); + public PropertiesDescriptor ConstantKeyword(Expression> propertyName) => AssignVariant, ConstantKeywordProperty>(propertyName, null); + public PropertiesDescriptor ConstantKeyword(Expression> propertyName, Action> configure) => AssignVariant, ConstantKeywordProperty>(propertyName, configure); + public PropertiesDescriptor DateNanos(PropertyName propertyName) => AssignVariant, DateNanosProperty>(propertyName, null); + public PropertiesDescriptor DateNanos(PropertyName propertyName, Action> configure) => AssignVariant, DateNanosProperty>(propertyName, configure); + public PropertiesDescriptor DateNanos(PropertyName propertyName, DateNanosProperty dateNanosProperty) => AssignVariant(propertyName, dateNanosProperty); + public PropertiesDescriptor DateNanos(Expression> propertyName) => AssignVariant, DateNanosProperty>(propertyName, null); + public PropertiesDescriptor DateNanos(Expression> propertyName, Action> configure) => AssignVariant, DateNanosProperty>(propertyName, configure); + public PropertiesDescriptor Date(PropertyName propertyName) => AssignVariant, DateProperty>(propertyName, null); + public PropertiesDescriptor Date(PropertyName propertyName, Action> configure) => AssignVariant, DateProperty>(propertyName, configure); + public PropertiesDescriptor Date(PropertyName propertyName, DateProperty dateProperty) => AssignVariant(propertyName, dateProperty); + public PropertiesDescriptor Date(Expression> propertyName) => AssignVariant, DateProperty>(propertyName, null); + public PropertiesDescriptor Date(Expression> propertyName, Action> configure) => AssignVariant, DateProperty>(propertyName, configure); + public PropertiesDescriptor DateRange(PropertyName propertyName) => AssignVariant, DateRangeProperty>(propertyName, null); + public PropertiesDescriptor DateRange(PropertyName propertyName, Action> configure) => AssignVariant, DateRangeProperty>(propertyName, configure); + public PropertiesDescriptor DateRange(PropertyName propertyName, DateRangeProperty dateRangeProperty) => AssignVariant(propertyName, dateRangeProperty); + public PropertiesDescriptor DateRange(Expression> propertyName) => AssignVariant, DateRangeProperty>(propertyName, null); + public PropertiesDescriptor DateRange(Expression> propertyName, Action> configure) => AssignVariant, DateRangeProperty>(propertyName, configure); + public PropertiesDescriptor DenseVector(PropertyName propertyName) => AssignVariant, DenseVectorProperty>(propertyName, null); + public PropertiesDescriptor DenseVector(PropertyName propertyName, Action> configure) => AssignVariant, DenseVectorProperty>(propertyName, configure); + public PropertiesDescriptor DenseVector(PropertyName propertyName, DenseVectorProperty denseVectorProperty) => AssignVariant(propertyName, denseVectorProperty); + public PropertiesDescriptor DenseVector(Expression> propertyName) => AssignVariant, DenseVectorProperty>(propertyName, null); + public PropertiesDescriptor DenseVector(Expression> propertyName, Action> configure) => AssignVariant, DenseVectorProperty>(propertyName, configure); + public PropertiesDescriptor DoubleNumber(PropertyName propertyName) => AssignVariant, DoubleNumberProperty>(propertyName, null); + public PropertiesDescriptor DoubleNumber(PropertyName propertyName, Action> configure) => AssignVariant, DoubleNumberProperty>(propertyName, configure); + public PropertiesDescriptor DoubleNumber(PropertyName propertyName, DoubleNumberProperty doubleNumberProperty) => AssignVariant(propertyName, doubleNumberProperty); + public PropertiesDescriptor DoubleNumber(Expression> propertyName) => AssignVariant, DoubleNumberProperty>(propertyName, null); + public PropertiesDescriptor DoubleNumber(Expression> propertyName, Action> configure) => AssignVariant, DoubleNumberProperty>(propertyName, configure); + public PropertiesDescriptor DoubleRange(PropertyName propertyName) => AssignVariant, DoubleRangeProperty>(propertyName, null); + public PropertiesDescriptor DoubleRange(PropertyName propertyName, Action> configure) => AssignVariant, DoubleRangeProperty>(propertyName, configure); + public PropertiesDescriptor DoubleRange(PropertyName propertyName, DoubleRangeProperty doubleRangeProperty) => AssignVariant(propertyName, doubleRangeProperty); + public PropertiesDescriptor DoubleRange(Expression> propertyName) => AssignVariant, DoubleRangeProperty>(propertyName, null); + public PropertiesDescriptor DoubleRange(Expression> propertyName, Action> configure) => AssignVariant, DoubleRangeProperty>(propertyName, configure); + public PropertiesDescriptor Dynamic(PropertyName propertyName) => AssignVariant, DynamicProperty>(propertyName, null); + public PropertiesDescriptor Dynamic(PropertyName propertyName, Action> configure) => AssignVariant, DynamicProperty>(propertyName, configure); + public PropertiesDescriptor Dynamic(PropertyName propertyName, DynamicProperty dynamicProperty) => AssignVariant(propertyName, dynamicProperty); + public PropertiesDescriptor Dynamic(Expression> propertyName) => AssignVariant, DynamicProperty>(propertyName, null); + public PropertiesDescriptor Dynamic(Expression> propertyName, Action> configure) => AssignVariant, DynamicProperty>(propertyName, configure); + public PropertiesDescriptor FieldAlias(PropertyName propertyName) => AssignVariant, FieldAliasProperty>(propertyName, null); + public PropertiesDescriptor FieldAlias(PropertyName propertyName, Action> configure) => AssignVariant, FieldAliasProperty>(propertyName, configure); + public PropertiesDescriptor FieldAlias(PropertyName propertyName, FieldAliasProperty fieldAliasProperty) => AssignVariant(propertyName, fieldAliasProperty); + public PropertiesDescriptor FieldAlias(Expression> propertyName) => AssignVariant, FieldAliasProperty>(propertyName, null); + public PropertiesDescriptor FieldAlias(Expression> propertyName, Action> configure) => AssignVariant, FieldAliasProperty>(propertyName, configure); + public PropertiesDescriptor Flattened(PropertyName propertyName) => AssignVariant, FlattenedProperty>(propertyName, null); + public PropertiesDescriptor Flattened(PropertyName propertyName, Action> configure) => AssignVariant, FlattenedProperty>(propertyName, configure); + public PropertiesDescriptor Flattened(PropertyName propertyName, FlattenedProperty flattenedProperty) => AssignVariant(propertyName, flattenedProperty); + public PropertiesDescriptor Flattened(Expression> propertyName) => AssignVariant, FlattenedProperty>(propertyName, null); + public PropertiesDescriptor Flattened(Expression> propertyName, Action> configure) => AssignVariant, FlattenedProperty>(propertyName, configure); + public PropertiesDescriptor FloatNumber(PropertyName propertyName) => AssignVariant, FloatNumberProperty>(propertyName, null); + public PropertiesDescriptor FloatNumber(PropertyName propertyName, Action> configure) => AssignVariant, FloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor FloatNumber(PropertyName propertyName, FloatNumberProperty floatNumberProperty) => AssignVariant(propertyName, floatNumberProperty); + public PropertiesDescriptor FloatNumber(Expression> propertyName) => AssignVariant, FloatNumberProperty>(propertyName, null); + public PropertiesDescriptor FloatNumber(Expression> propertyName, Action> configure) => AssignVariant, FloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor FloatRange(PropertyName propertyName) => AssignVariant, FloatRangeProperty>(propertyName, null); + public PropertiesDescriptor FloatRange(PropertyName propertyName, Action> configure) => AssignVariant, FloatRangeProperty>(propertyName, configure); + public PropertiesDescriptor FloatRange(PropertyName propertyName, FloatRangeProperty floatRangeProperty) => AssignVariant(propertyName, floatRangeProperty); + public PropertiesDescriptor FloatRange(Expression> propertyName) => AssignVariant, FloatRangeProperty>(propertyName, null); + public PropertiesDescriptor FloatRange(Expression> propertyName, Action> configure) => AssignVariant, FloatRangeProperty>(propertyName, configure); + public PropertiesDescriptor GeoPoint(PropertyName propertyName) => AssignVariant, GeoPointProperty>(propertyName, null); + public PropertiesDescriptor GeoPoint(PropertyName propertyName, Action> configure) => AssignVariant, GeoPointProperty>(propertyName, configure); + public PropertiesDescriptor GeoPoint(PropertyName propertyName, GeoPointProperty geoPointProperty) => AssignVariant(propertyName, geoPointProperty); + public PropertiesDescriptor GeoPoint(Expression> propertyName) => AssignVariant, GeoPointProperty>(propertyName, null); + public PropertiesDescriptor GeoPoint(Expression> propertyName, Action> configure) => AssignVariant, GeoPointProperty>(propertyName, configure); + public PropertiesDescriptor GeoShape(PropertyName propertyName) => AssignVariant, GeoShapeProperty>(propertyName, null); + public PropertiesDescriptor GeoShape(PropertyName propertyName, Action> configure) => AssignVariant, GeoShapeProperty>(propertyName, configure); + public PropertiesDescriptor GeoShape(PropertyName propertyName, GeoShapeProperty geoShapeProperty) => AssignVariant(propertyName, geoShapeProperty); + public PropertiesDescriptor GeoShape(Expression> propertyName) => AssignVariant, GeoShapeProperty>(propertyName, null); + public PropertiesDescriptor GeoShape(Expression> propertyName, Action> configure) => AssignVariant, GeoShapeProperty>(propertyName, configure); + public PropertiesDescriptor HalfFloatNumber(PropertyName propertyName) => AssignVariant, HalfFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor HalfFloatNumber(PropertyName propertyName, Action> configure) => AssignVariant, HalfFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor HalfFloatNumber(PropertyName propertyName, HalfFloatNumberProperty halfFloatNumberProperty) => AssignVariant(propertyName, halfFloatNumberProperty); + public PropertiesDescriptor HalfFloatNumber(Expression> propertyName) => AssignVariant, HalfFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor HalfFloatNumber(Expression> propertyName, Action> configure) => AssignVariant, HalfFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor Histogram(PropertyName propertyName) => AssignVariant, HistogramProperty>(propertyName, null); + public PropertiesDescriptor Histogram(PropertyName propertyName, Action> configure) => AssignVariant, HistogramProperty>(propertyName, configure); + public PropertiesDescriptor Histogram(PropertyName propertyName, HistogramProperty histogramProperty) => AssignVariant(propertyName, histogramProperty); + public PropertiesDescriptor Histogram(Expression> propertyName) => AssignVariant, HistogramProperty>(propertyName, null); + public PropertiesDescriptor Histogram(Expression> propertyName, Action> configure) => AssignVariant, HistogramProperty>(propertyName, configure); + public PropertiesDescriptor IntegerNumber(PropertyName propertyName) => AssignVariant, IntegerNumberProperty>(propertyName, null); + public PropertiesDescriptor IntegerNumber(PropertyName propertyName, Action> configure) => AssignVariant, IntegerNumberProperty>(propertyName, configure); + public PropertiesDescriptor IntegerNumber(PropertyName propertyName, IntegerNumberProperty integerNumberProperty) => AssignVariant(propertyName, integerNumberProperty); + public PropertiesDescriptor IntegerNumber(Expression> propertyName) => AssignVariant, IntegerNumberProperty>(propertyName, null); + public PropertiesDescriptor IntegerNumber(Expression> propertyName, Action> configure) => AssignVariant, IntegerNumberProperty>(propertyName, configure); + public PropertiesDescriptor IntegerRange(PropertyName propertyName) => AssignVariant, IntegerRangeProperty>(propertyName, null); + public PropertiesDescriptor IntegerRange(PropertyName propertyName, Action> configure) => AssignVariant, IntegerRangeProperty>(propertyName, configure); + public PropertiesDescriptor IntegerRange(PropertyName propertyName, IntegerRangeProperty integerRangeProperty) => AssignVariant(propertyName, integerRangeProperty); + public PropertiesDescriptor IntegerRange(Expression> propertyName) => AssignVariant, IntegerRangeProperty>(propertyName, null); + public PropertiesDescriptor IntegerRange(Expression> propertyName, Action> configure) => AssignVariant, IntegerRangeProperty>(propertyName, configure); + public PropertiesDescriptor Ip(PropertyName propertyName) => AssignVariant, IpProperty>(propertyName, null); + public PropertiesDescriptor Ip(PropertyName propertyName, Action> configure) => AssignVariant, IpProperty>(propertyName, configure); + public PropertiesDescriptor Ip(PropertyName propertyName, IpProperty ipProperty) => AssignVariant(propertyName, ipProperty); + public PropertiesDescriptor Ip(Expression> propertyName) => AssignVariant, IpProperty>(propertyName, null); + public PropertiesDescriptor Ip(Expression> propertyName, Action> configure) => AssignVariant, IpProperty>(propertyName, configure); + public PropertiesDescriptor IpRange(PropertyName propertyName) => AssignVariant, IpRangeProperty>(propertyName, null); + public PropertiesDescriptor IpRange(PropertyName propertyName, Action> configure) => AssignVariant, IpRangeProperty>(propertyName, configure); + public PropertiesDescriptor IpRange(PropertyName propertyName, IpRangeProperty ipRangeProperty) => AssignVariant(propertyName, ipRangeProperty); + public PropertiesDescriptor IpRange(Expression> propertyName) => AssignVariant, IpRangeProperty>(propertyName, null); + public PropertiesDescriptor IpRange(Expression> propertyName, Action> configure) => AssignVariant, IpRangeProperty>(propertyName, configure); + public PropertiesDescriptor Join(PropertyName propertyName) => AssignVariant, JoinProperty>(propertyName, null); + public PropertiesDescriptor Join(PropertyName propertyName, Action> configure) => AssignVariant, JoinProperty>(propertyName, configure); + public PropertiesDescriptor Join(PropertyName propertyName, JoinProperty joinProperty) => AssignVariant(propertyName, joinProperty); + public PropertiesDescriptor Join(Expression> propertyName) => AssignVariant, JoinProperty>(propertyName, null); + public PropertiesDescriptor Join(Expression> propertyName, Action> configure) => AssignVariant, JoinProperty>(propertyName, configure); + public PropertiesDescriptor Keyword(PropertyName propertyName) => AssignVariant, KeywordProperty>(propertyName, null); + public PropertiesDescriptor Keyword(PropertyName propertyName, Action> configure) => AssignVariant, KeywordProperty>(propertyName, configure); + public PropertiesDescriptor Keyword(PropertyName propertyName, KeywordProperty keywordProperty) => AssignVariant(propertyName, keywordProperty); + public PropertiesDescriptor Keyword(Expression> propertyName) => AssignVariant, KeywordProperty>(propertyName, null); + public PropertiesDescriptor Keyword(Expression> propertyName, Action> configure) => AssignVariant, KeywordProperty>(propertyName, configure); + public PropertiesDescriptor LongNumber(PropertyName propertyName) => AssignVariant, LongNumberProperty>(propertyName, null); + public PropertiesDescriptor LongNumber(PropertyName propertyName, Action> configure) => AssignVariant, LongNumberProperty>(propertyName, configure); + public PropertiesDescriptor LongNumber(PropertyName propertyName, LongNumberProperty longNumberProperty) => AssignVariant(propertyName, longNumberProperty); + public PropertiesDescriptor LongNumber(Expression> propertyName) => AssignVariant, LongNumberProperty>(propertyName, null); + public PropertiesDescriptor LongNumber(Expression> propertyName, Action> configure) => AssignVariant, LongNumberProperty>(propertyName, configure); + public PropertiesDescriptor LongRange(PropertyName propertyName) => AssignVariant, LongRangeProperty>(propertyName, null); + public PropertiesDescriptor LongRange(PropertyName propertyName, Action> configure) => AssignVariant, LongRangeProperty>(propertyName, configure); + public PropertiesDescriptor LongRange(PropertyName propertyName, LongRangeProperty longRangeProperty) => AssignVariant(propertyName, longRangeProperty); + public PropertiesDescriptor LongRange(Expression> propertyName) => AssignVariant, LongRangeProperty>(propertyName, null); + public PropertiesDescriptor LongRange(Expression> propertyName, Action> configure) => AssignVariant, LongRangeProperty>(propertyName, configure); + public PropertiesDescriptor MatchOnlyText(PropertyName propertyName) => AssignVariant, MatchOnlyTextProperty>(propertyName, null); + public PropertiesDescriptor MatchOnlyText(PropertyName propertyName, Action> configure) => AssignVariant, MatchOnlyTextProperty>(propertyName, configure); + public PropertiesDescriptor MatchOnlyText(PropertyName propertyName, MatchOnlyTextProperty matchOnlyTextProperty) => AssignVariant(propertyName, matchOnlyTextProperty); + public PropertiesDescriptor MatchOnlyText(Expression> propertyName) => AssignVariant, MatchOnlyTextProperty>(propertyName, null); + public PropertiesDescriptor MatchOnlyText(Expression> propertyName, Action> configure) => AssignVariant, MatchOnlyTextProperty>(propertyName, configure); + public PropertiesDescriptor Murmur3Hash(PropertyName propertyName) => AssignVariant, Murmur3HashProperty>(propertyName, null); + public PropertiesDescriptor Murmur3Hash(PropertyName propertyName, Action> configure) => AssignVariant, Murmur3HashProperty>(propertyName, configure); + public PropertiesDescriptor Murmur3Hash(PropertyName propertyName, Murmur3HashProperty murmur3HashProperty) => AssignVariant(propertyName, murmur3HashProperty); + public PropertiesDescriptor Murmur3Hash(Expression> propertyName) => AssignVariant, Murmur3HashProperty>(propertyName, null); + public PropertiesDescriptor Murmur3Hash(Expression> propertyName, Action> configure) => AssignVariant, Murmur3HashProperty>(propertyName, configure); + public PropertiesDescriptor Nested(PropertyName propertyName) => AssignVariant, NestedProperty>(propertyName, null); + public PropertiesDescriptor Nested(PropertyName propertyName, Action> configure) => AssignVariant, NestedProperty>(propertyName, configure); + public PropertiesDescriptor Nested(PropertyName propertyName, NestedProperty nestedProperty) => AssignVariant(propertyName, nestedProperty); + public PropertiesDescriptor Nested(Expression> propertyName) => AssignVariant, NestedProperty>(propertyName, null); + public PropertiesDescriptor Nested(Expression> propertyName, Action> configure) => AssignVariant, NestedProperty>(propertyName, configure); + public PropertiesDescriptor Object(PropertyName propertyName) => AssignVariant, ObjectProperty>(propertyName, null); + public PropertiesDescriptor Object(PropertyName propertyName, Action> configure) => AssignVariant, ObjectProperty>(propertyName, configure); + public PropertiesDescriptor Object(PropertyName propertyName, ObjectProperty objectProperty) => AssignVariant(propertyName, objectProperty); + public PropertiesDescriptor Object(Expression> propertyName) => AssignVariant, ObjectProperty>(propertyName, null); + public PropertiesDescriptor Object(Expression> propertyName, Action> configure) => AssignVariant, ObjectProperty>(propertyName, configure); + public PropertiesDescriptor Percolator(PropertyName propertyName) => AssignVariant, PercolatorProperty>(propertyName, null); + public PropertiesDescriptor Percolator(PropertyName propertyName, Action> configure) => AssignVariant, PercolatorProperty>(propertyName, configure); + public PropertiesDescriptor Percolator(PropertyName propertyName, PercolatorProperty percolatorProperty) => AssignVariant(propertyName, percolatorProperty); + public PropertiesDescriptor Percolator(Expression> propertyName) => AssignVariant, PercolatorProperty>(propertyName, null); + public PropertiesDescriptor Percolator(Expression> propertyName, Action> configure) => AssignVariant, PercolatorProperty>(propertyName, configure); + public PropertiesDescriptor Point(PropertyName propertyName) => AssignVariant, PointProperty>(propertyName, null); + public PropertiesDescriptor Point(PropertyName propertyName, Action> configure) => AssignVariant, PointProperty>(propertyName, configure); + public PropertiesDescriptor Point(PropertyName propertyName, PointProperty pointProperty) => AssignVariant(propertyName, pointProperty); + public PropertiesDescriptor Point(Expression> propertyName) => AssignVariant, PointProperty>(propertyName, null); + public PropertiesDescriptor Point(Expression> propertyName, Action> configure) => AssignVariant, PointProperty>(propertyName, configure); + public PropertiesDescriptor RankFeature(PropertyName propertyName) => AssignVariant, RankFeatureProperty>(propertyName, null); + public PropertiesDescriptor RankFeature(PropertyName propertyName, Action> configure) => AssignVariant, RankFeatureProperty>(propertyName, configure); + public PropertiesDescriptor RankFeature(PropertyName propertyName, RankFeatureProperty rankFeatureProperty) => AssignVariant(propertyName, rankFeatureProperty); + public PropertiesDescriptor RankFeature(Expression> propertyName) => AssignVariant, RankFeatureProperty>(propertyName, null); + public PropertiesDescriptor RankFeature(Expression> propertyName, Action> configure) => AssignVariant, RankFeatureProperty>(propertyName, configure); + public PropertiesDescriptor RankFeatures(PropertyName propertyName) => AssignVariant, RankFeaturesProperty>(propertyName, null); + public PropertiesDescriptor RankFeatures(PropertyName propertyName, Action> configure) => AssignVariant, RankFeaturesProperty>(propertyName, configure); + public PropertiesDescriptor RankFeatures(PropertyName propertyName, RankFeaturesProperty rankFeaturesProperty) => AssignVariant(propertyName, rankFeaturesProperty); + public PropertiesDescriptor RankFeatures(Expression> propertyName) => AssignVariant, RankFeaturesProperty>(propertyName, null); + public PropertiesDescriptor RankFeatures(Expression> propertyName, Action> configure) => AssignVariant, RankFeaturesProperty>(propertyName, configure); + public PropertiesDescriptor ScaledFloatNumber(PropertyName propertyName) => AssignVariant, ScaledFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor ScaledFloatNumber(PropertyName propertyName, Action> configure) => AssignVariant, ScaledFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor ScaledFloatNumber(PropertyName propertyName, ScaledFloatNumberProperty scaledFloatNumberProperty) => AssignVariant(propertyName, scaledFloatNumberProperty); + public PropertiesDescriptor ScaledFloatNumber(Expression> propertyName) => AssignVariant, ScaledFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor ScaledFloatNumber(Expression> propertyName, Action> configure) => AssignVariant, ScaledFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor SearchAsYouType(PropertyName propertyName) => AssignVariant, SearchAsYouTypeProperty>(propertyName, null); + public PropertiesDescriptor SearchAsYouType(PropertyName propertyName, Action> configure) => AssignVariant, SearchAsYouTypeProperty>(propertyName, configure); + public PropertiesDescriptor SearchAsYouType(PropertyName propertyName, SearchAsYouTypeProperty searchAsYouTypeProperty) => AssignVariant(propertyName, searchAsYouTypeProperty); + public PropertiesDescriptor SearchAsYouType(Expression> propertyName) => AssignVariant, SearchAsYouTypeProperty>(propertyName, null); + public PropertiesDescriptor SearchAsYouType(Expression> propertyName, Action> configure) => AssignVariant, SearchAsYouTypeProperty>(propertyName, configure); + public PropertiesDescriptor Shape(PropertyName propertyName) => AssignVariant, ShapeProperty>(propertyName, null); + public PropertiesDescriptor Shape(PropertyName propertyName, Action> configure) => AssignVariant, ShapeProperty>(propertyName, configure); + public PropertiesDescriptor Shape(PropertyName propertyName, ShapeProperty shapeProperty) => AssignVariant(propertyName, shapeProperty); + public PropertiesDescriptor Shape(Expression> propertyName) => AssignVariant, ShapeProperty>(propertyName, null); + public PropertiesDescriptor Shape(Expression> propertyName, Action> configure) => AssignVariant, ShapeProperty>(propertyName, configure); + public PropertiesDescriptor ShortNumber(PropertyName propertyName) => AssignVariant, ShortNumberProperty>(propertyName, null); + public PropertiesDescriptor ShortNumber(PropertyName propertyName, Action> configure) => AssignVariant, ShortNumberProperty>(propertyName, configure); + public PropertiesDescriptor ShortNumber(PropertyName propertyName, ShortNumberProperty shortNumberProperty) => AssignVariant(propertyName, shortNumberProperty); + public PropertiesDescriptor ShortNumber(Expression> propertyName) => AssignVariant, ShortNumberProperty>(propertyName, null); + public PropertiesDescriptor ShortNumber(Expression> propertyName, Action> configure) => AssignVariant, ShortNumberProperty>(propertyName, configure); + public PropertiesDescriptor Text(PropertyName propertyName) => AssignVariant, TextProperty>(propertyName, null); + public PropertiesDescriptor Text(PropertyName propertyName, Action> configure) => AssignVariant, TextProperty>(propertyName, configure); + public PropertiesDescriptor Text(PropertyName propertyName, TextProperty textProperty) => AssignVariant(propertyName, textProperty); + public PropertiesDescriptor Text(Expression> propertyName) => AssignVariant, TextProperty>(propertyName, null); + public PropertiesDescriptor Text(Expression> propertyName, Action> configure) => AssignVariant, TextProperty>(propertyName, configure); + public PropertiesDescriptor TokenCount(PropertyName propertyName) => AssignVariant, TokenCountProperty>(propertyName, null); + public PropertiesDescriptor TokenCount(PropertyName propertyName, Action> configure) => AssignVariant, TokenCountProperty>(propertyName, configure); + public PropertiesDescriptor TokenCount(PropertyName propertyName, TokenCountProperty tokenCountProperty) => AssignVariant(propertyName, tokenCountProperty); + public PropertiesDescriptor TokenCount(Expression> propertyName) => AssignVariant, TokenCountProperty>(propertyName, null); + public PropertiesDescriptor TokenCount(Expression> propertyName, Action> configure) => AssignVariant, TokenCountProperty>(propertyName, configure); + public PropertiesDescriptor UnsignedLongNumber(PropertyName propertyName) => AssignVariant, UnsignedLongNumberProperty>(propertyName, null); + public PropertiesDescriptor UnsignedLongNumber(PropertyName propertyName, Action> configure) => AssignVariant, UnsignedLongNumberProperty>(propertyName, configure); + public PropertiesDescriptor UnsignedLongNumber(PropertyName propertyName, UnsignedLongNumberProperty unsignedLongNumberProperty) => AssignVariant(propertyName, unsignedLongNumberProperty); + public PropertiesDescriptor UnsignedLongNumber(Expression> propertyName) => AssignVariant, UnsignedLongNumberProperty>(propertyName, null); + public PropertiesDescriptor UnsignedLongNumber(Expression> propertyName, Action> configure) => AssignVariant, UnsignedLongNumberProperty>(propertyName, configure); + public PropertiesDescriptor Version(PropertyName propertyName) => AssignVariant, VersionProperty>(propertyName, null); + public PropertiesDescriptor Version(PropertyName propertyName, Action> configure) => AssignVariant, VersionProperty>(propertyName, configure); + public PropertiesDescriptor Version(PropertyName propertyName, VersionProperty versionProperty) => AssignVariant(propertyName, versionProperty); + public PropertiesDescriptor Version(Expression> propertyName) => AssignVariant, VersionProperty>(propertyName, null); + public PropertiesDescriptor Version(Expression> propertyName, Action> configure) => AssignVariant, VersionProperty>(propertyName, configure); + public PropertiesDescriptor Wildcard(PropertyName propertyName) => AssignVariant, WildcardProperty>(propertyName, null); + public PropertiesDescriptor Wildcard(PropertyName propertyName, Action> configure) => AssignVariant, WildcardProperty>(propertyName, configure); + public PropertiesDescriptor Wildcard(PropertyName propertyName, WildcardProperty wildcardProperty) => AssignVariant(propertyName, wildcardProperty); + public PropertiesDescriptor Wildcard(Expression> propertyName) => AssignVariant, WildcardProperty>(propertyName, null); + public PropertiesDescriptor Wildcard(Expression> propertyName, Action> configure) => AssignVariant, WildcardProperty>(propertyName, configure); +} + +internal sealed partial class PropertyInterfaceConverter : JsonConverter +{ + public override IProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var copiedReader = reader; + string? type = null; + using var jsonDoc = JsonDocument.ParseValue(ref copiedReader); + if (jsonDoc is not null && jsonDoc.RootElement.TryGetProperty("type", out var readType) && readType.ValueKind == JsonValueKind.String) + { + type = readType.ToString(); + } + + switch (type) + { + case "long_range": + return JsonSerializer.Deserialize(ref reader, options); + case "ip_range": + return JsonSerializer.Deserialize(ref reader, options); + case "integer_range": + return JsonSerializer.Deserialize(ref reader, options); + case "float_range": + return JsonSerializer.Deserialize(ref reader, options); + case "double_range": + return JsonSerializer.Deserialize(ref reader, options); + case "date_range": + return JsonSerializer.Deserialize(ref reader, options); + case "unsigned_long": + return JsonSerializer.Deserialize(ref reader, options); + case "short": + return JsonSerializer.Deserialize(ref reader, options); + case "scaled_float": + return JsonSerializer.Deserialize(ref reader, options); + case "long": + return JsonSerializer.Deserialize(ref reader, options); + case "integer": + return JsonSerializer.Deserialize(ref reader, options); + case "half_float": + return JsonSerializer.Deserialize(ref reader, options); + case "float": + return JsonSerializer.Deserialize(ref reader, options); + case "double": + return JsonSerializer.Deserialize(ref reader, options); + case "byte": + return JsonSerializer.Deserialize(ref reader, options); + case "shape": + return JsonSerializer.Deserialize(ref reader, options); + case "point": + return JsonSerializer.Deserialize(ref reader, options); + case "geo_shape": + return JsonSerializer.Deserialize(ref reader, options); + case "geo_point": + return JsonSerializer.Deserialize(ref reader, options); + case "token_count": + return JsonSerializer.Deserialize(ref reader, options); + case "murmur3": + return JsonSerializer.Deserialize(ref reader, options); + case "ip": + return JsonSerializer.Deserialize(ref reader, options); + case "histogram": + return JsonSerializer.Deserialize(ref reader, options); + case "alias": + return JsonSerializer.Deserialize(ref reader, options); + case "constant_keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "completion": + return JsonSerializer.Deserialize(ref reader, options); + case "object": + return JsonSerializer.Deserialize(ref reader, options); + case "nested": + return JsonSerializer.Deserialize(ref reader, options); + case "flattened": + return JsonSerializer.Deserialize(ref reader, options); + case "dense_vector": + return JsonSerializer.Deserialize(ref reader, options); + case "aggregate_metric_double": + return JsonSerializer.Deserialize(ref reader, options); + case "date": + return JsonSerializer.Deserialize(ref reader, options); + case "date_nanos": + return JsonSerializer.Deserialize(ref reader, options); + case "wildcard": + return JsonSerializer.Deserialize(ref reader, options); + case "version": + return JsonSerializer.Deserialize(ref reader, options); + case "text": + return JsonSerializer.Deserialize(ref reader, options); + case "search_as_you_type": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_features": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_feature": + return JsonSerializer.Deserialize(ref reader, options); + case "percolator": + return JsonSerializer.Deserialize(ref reader, options); + case "match_only_text": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "join": + return JsonSerializer.Deserialize(ref reader, options); + case "{dynamic_property}": + return JsonSerializer.Deserialize(ref reader, options); + case "boolean": + return JsonSerializer.Deserialize(ref reader, options); + case "binary": + return JsonSerializer.Deserialize(ref reader, options); + case null: + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IProperty)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, IProperty value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "long_range": + JsonSerializer.Serialize(writer, value, typeof(LongRangeProperty), options); + return; + case "ip_range": + JsonSerializer.Serialize(writer, value, typeof(IpRangeProperty), options); + return; + case "integer_range": + JsonSerializer.Serialize(writer, value, typeof(IntegerRangeProperty), options); + return; + case "float_range": + JsonSerializer.Serialize(writer, value, typeof(FloatRangeProperty), options); + return; + case "double_range": + JsonSerializer.Serialize(writer, value, typeof(DoubleRangeProperty), options); + return; + case "date_range": + JsonSerializer.Serialize(writer, value, typeof(DateRangeProperty), options); + return; + case "unsigned_long": + JsonSerializer.Serialize(writer, value, typeof(UnsignedLongNumberProperty), options); + return; + case "short": + JsonSerializer.Serialize(writer, value, typeof(ShortNumberProperty), options); + return; + case "scaled_float": + JsonSerializer.Serialize(writer, value, typeof(ScaledFloatNumberProperty), options); + return; + case "long": + JsonSerializer.Serialize(writer, value, typeof(LongNumberProperty), options); + return; + case "integer": + JsonSerializer.Serialize(writer, value, typeof(IntegerNumberProperty), options); + return; + case "half_float": + JsonSerializer.Serialize(writer, value, typeof(HalfFloatNumberProperty), options); + return; + case "float": + JsonSerializer.Serialize(writer, value, typeof(FloatNumberProperty), options); + return; + case "double": + JsonSerializer.Serialize(writer, value, typeof(DoubleNumberProperty), options); + return; + case "byte": + JsonSerializer.Serialize(writer, value, typeof(ByteNumberProperty), options); + return; + case "shape": + JsonSerializer.Serialize(writer, value, typeof(ShapeProperty), options); + return; + case "point": + JsonSerializer.Serialize(writer, value, typeof(PointProperty), options); + return; + case "geo_shape": + JsonSerializer.Serialize(writer, value, typeof(GeoShapeProperty), options); + return; + case "geo_point": + JsonSerializer.Serialize(writer, value, typeof(GeoPointProperty), options); + return; + case "token_count": + JsonSerializer.Serialize(writer, value, typeof(TokenCountProperty), options); + return; + case "murmur3": + JsonSerializer.Serialize(writer, value, typeof(Murmur3HashProperty), options); + return; + case "ip": + JsonSerializer.Serialize(writer, value, typeof(IpProperty), options); + return; + case "histogram": + JsonSerializer.Serialize(writer, value, typeof(HistogramProperty), options); + return; + case "alias": + JsonSerializer.Serialize(writer, value, typeof(FieldAliasProperty), options); + return; + case "constant_keyword": + JsonSerializer.Serialize(writer, value, typeof(ConstantKeywordProperty), options); + return; + case "completion": + JsonSerializer.Serialize(writer, value, typeof(CompletionProperty), options); + return; + case "object": + JsonSerializer.Serialize(writer, value, typeof(ObjectProperty), options); + return; + case "nested": + JsonSerializer.Serialize(writer, value, typeof(NestedProperty), options); + return; + case "flattened": + JsonSerializer.Serialize(writer, value, typeof(FlattenedProperty), options); + return; + case "dense_vector": + JsonSerializer.Serialize(writer, value, typeof(DenseVectorProperty), options); + return; + case "aggregate_metric_double": + JsonSerializer.Serialize(writer, value, typeof(AggregateMetricDoubleProperty), options); + return; + case "date": + JsonSerializer.Serialize(writer, value, typeof(DateProperty), options); + return; + case "date_nanos": + JsonSerializer.Serialize(writer, value, typeof(DateNanosProperty), options); + return; + case "wildcard": + JsonSerializer.Serialize(writer, value, typeof(WildcardProperty), options); + return; + case "version": + JsonSerializer.Serialize(writer, value, typeof(VersionProperty), options); + return; + case "text": + JsonSerializer.Serialize(writer, value, typeof(TextProperty), options); + return; + case "search_as_you_type": + JsonSerializer.Serialize(writer, value, typeof(SearchAsYouTypeProperty), options); + return; + case "rank_features": + JsonSerializer.Serialize(writer, value, typeof(RankFeaturesProperty), options); + return; + case "rank_feature": + JsonSerializer.Serialize(writer, value, typeof(RankFeatureProperty), options); + return; + case "percolator": + JsonSerializer.Serialize(writer, value, typeof(PercolatorProperty), options); + return; + case "match_only_text": + JsonSerializer.Serialize(writer, value, typeof(MatchOnlyTextProperty), options); + return; + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(KeywordProperty), options); + return; + case "join": + JsonSerializer.Serialize(writer, value, typeof(JoinProperty), options); + return; + case "{dynamic_property}": + JsonSerializer.Serialize(writer, value, typeof(DynamicProperty), options); + return; + case "boolean": + JsonSerializer.Serialize(writer, value, typeof(BooleanProperty), options); + return; + case "binary": + JsonSerializer.Serialize(writer, value, typeof(BinaryProperty), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(PropertyInterfaceConverter))] +public partial interface IProperty +{ + public string Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs new file mode 100644 index 00000000000..3043000010f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs @@ -0,0 +1,315 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class RankFeatureProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("positive_score_impact")] + public bool? PositiveScoreImpact { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "rank_feature"; +} + +public sealed partial class RankFeaturePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal RankFeaturePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public RankFeaturePropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? PositiveScoreImpactValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public RankFeaturePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RankFeaturePropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PositiveScoreImpactValue.HasValue) + { + writer.WritePropertyName("positive_score_impact"); + writer.WriteBooleanValue(PositiveScoreImpactValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("rank_feature"); + writer.WriteEndObject(); + } + + RankFeatureProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + PositiveScoreImpact = PositiveScoreImpactValue, + Properties = PropertiesValue + }; +} + +public sealed partial class RankFeaturePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal RankFeaturePropertyDescriptor(Action configure) => configure.Invoke(this); + + public RankFeaturePropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? PositiveScoreImpactValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public RankFeaturePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RankFeaturePropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PositiveScoreImpactValue.HasValue) + { + writer.WritePropertyName("positive_score_impact"); + writer.WriteBooleanValue(PositiveScoreImpactValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("rank_feature"); + writer.WriteEndObject(); + } + + RankFeatureProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + PositiveScoreImpact = PositiveScoreImpactValue, + Properties = PropertiesValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs new file mode 100644 index 00000000000..7ec5e00954f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs @@ -0,0 +1,285 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class RankFeaturesProperty : IProperty +{ + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "rank_features"; +} + +public sealed partial class RankFeaturesPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal RankFeaturesPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public RankFeaturesPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("rank_features"); + writer.WriteEndObject(); + } + + RankFeaturesProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} + +public sealed partial class RankFeaturesPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal RankFeaturesPropertyDescriptor(Action configure) => configure.Invoke(this); + + public RankFeaturesPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + + public RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public RankFeaturesPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("rank_features"); + writer.WriteEndObject(); + } + + RankFeaturesProperty IBuildableDescriptor.Build() => new() + { + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RoutingField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RoutingField.g.cs new file mode 100644 index 00000000000..f83e863b71d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RoutingField.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class RoutingField +{ + [JsonInclude, JsonPropertyName("required")] + public bool Required { get; set; } +} + +public sealed partial class RoutingFieldDescriptor : SerializableDescriptor +{ + internal RoutingFieldDescriptor(Action configure) => configure.Invoke(this); + + public RoutingFieldDescriptor() : base() + { + } + + private bool RequiredValue { get; set; } + + public RoutingFieldDescriptor Required(bool required = true) + { + RequiredValue = required; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("required"); + writer.WriteBooleanValue(RequiredValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs new file mode 100644 index 00000000000..9ca4e400bbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs @@ -0,0 +1,491 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class RuntimeField +{ + /// + /// For type `lookup` + /// + [JsonInclude, JsonPropertyName("fetch_fields")] + public ICollection? FetchFields { get; set; } + + /// + /// A custom format for `date` type runtime fields. + /// + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// For type `lookup` + /// + [JsonInclude, JsonPropertyName("input_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? InputField { get; set; } + + /// + /// Painless script executed at query time. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + /// + /// For type `lookup` + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + /// + /// For type `lookup` + /// + [JsonInclude, JsonPropertyName("target_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? TargetIndex { get; set; } + + /// + /// Field type, which can be: `boolean`, `composite`, `date`, `double`, `geo_point`, `ip`,`keyword`, `long`, or `lookup`. + /// + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldType Type { get; set; } +} + +public sealed partial class RuntimeFieldDescriptor : SerializableDescriptor> +{ + internal RuntimeFieldDescriptor(Action> configure) => configure.Invoke(this); + + public RuntimeFieldDescriptor() : base() + { + } + + private ICollection? FetchFieldsValue { get; set; } + private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } + private Action> FetchFieldsDescriptorAction { get; set; } + private Action>[] FetchFieldsDescriptorActions { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? InputFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? TargetIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldType TypeValue { get; set; } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor FetchFields(ICollection? fetchFields) + { + FetchFieldsDescriptor = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = null; + FetchFieldsValue = fetchFields; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(RuntimeFieldFetchFieldsDescriptor descriptor) + { + FetchFieldsValue = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = null; + FetchFieldsDescriptor = descriptor; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(Action> configure) + { + FetchFieldsValue = null; + FetchFieldsDescriptor = null; + FetchFieldsDescriptorActions = null; + FetchFieldsDescriptorAction = configure; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(params Action>[] configure) + { + FetchFieldsValue = null; + FetchFieldsDescriptor = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = configure; + return Self; + } + + /// + /// A custom format for `date` type runtime fields. + /// + public RuntimeFieldDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor InputField(Elastic.Clients.Elasticsearch.Serverless.Field? inputField) + { + InputFieldValue = inputField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor InputField(Expression> inputField) + { + InputFieldValue = inputField; + return Self; + } + + /// + /// Painless script executed at query time. + /// + public RuntimeFieldDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetIndex(Elastic.Clients.Elasticsearch.Serverless.IndexName? targetIndex) + { + TargetIndexValue = targetIndex; + return Self; + } + + /// + /// Field type, which can be: `boolean`, `composite`, `date`, `double`, `geo_point`, `ip`,`keyword`, `long`, or `lookup`. + /// + public RuntimeFieldDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchFieldsDescriptor is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FetchFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FetchFieldsDescriptorAction is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FetchFieldsDescriptorActions is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + foreach (var action in FetchFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FetchFieldsValue is not null) + { + writer.WritePropertyName("fetch_fields"); + JsonSerializer.Serialize(writer, FetchFieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (InputFieldValue is not null) + { + writer.WritePropertyName("input_field"); + JsonSerializer.Serialize(writer, InputFieldValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (TargetIndexValue is not null) + { + writer.WritePropertyName("target_index"); + JsonSerializer.Serialize(writer, TargetIndexValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class RuntimeFieldDescriptor : SerializableDescriptor +{ + internal RuntimeFieldDescriptor(Action configure) => configure.Invoke(this); + + public RuntimeFieldDescriptor() : base() + { + } + + private ICollection? FetchFieldsValue { get; set; } + private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } + private Action FetchFieldsDescriptorAction { get; set; } + private Action[] FetchFieldsDescriptorActions { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? InputFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? TargetIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldType TypeValue { get; set; } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor FetchFields(ICollection? fetchFields) + { + FetchFieldsDescriptor = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = null; + FetchFieldsValue = fetchFields; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(RuntimeFieldFetchFieldsDescriptor descriptor) + { + FetchFieldsValue = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = null; + FetchFieldsDescriptor = descriptor; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(Action configure) + { + FetchFieldsValue = null; + FetchFieldsDescriptor = null; + FetchFieldsDescriptorActions = null; + FetchFieldsDescriptorAction = configure; + return Self; + } + + public RuntimeFieldDescriptor FetchFields(params Action[] configure) + { + FetchFieldsValue = null; + FetchFieldsDescriptor = null; + FetchFieldsDescriptorAction = null; + FetchFieldsDescriptorActions = configure; + return Self; + } + + /// + /// A custom format for `date` type runtime fields. + /// + public RuntimeFieldDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor InputField(Elastic.Clients.Elasticsearch.Serverless.Field? inputField) + { + InputFieldValue = inputField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor InputField(Expression> inputField) + { + InputFieldValue = inputField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor InputField(Expression> inputField) + { + InputFieldValue = inputField; + return Self; + } + + /// + /// Painless script executed at query time. + /// + public RuntimeFieldDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// For type `lookup` + /// + public RuntimeFieldDescriptor TargetIndex(Elastic.Clients.Elasticsearch.Serverless.IndexName? targetIndex) + { + TargetIndexValue = targetIndex; + return Self; + } + + /// + /// Field type, which can be: `boolean`, `composite`, `date`, `double`, `geo_point`, `ip`,`keyword`, `long`, or `lookup`. + /// + public RuntimeFieldDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchFieldsDescriptor is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FetchFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FetchFieldsDescriptorAction is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FetchFieldsDescriptorActions is not null) + { + writer.WritePropertyName("fetch_fields"); + writer.WriteStartArray(); + foreach (var action in FetchFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FetchFieldsValue is not null) + { + writer.WritePropertyName("fetch_fields"); + JsonSerializer.Serialize(writer, FetchFieldsValue, options); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (InputFieldValue is not null) + { + writer.WritePropertyName("input_field"); + JsonSerializer.Serialize(writer, InputFieldValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + if (TargetIndexValue is not null) + { + writer.WritePropertyName("target_index"); + JsonSerializer.Serialize(writer, TargetIndexValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs new file mode 100644 index 00000000000..4703808d523 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class RuntimeFieldFetchFields +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } +} + +public sealed partial class RuntimeFieldFetchFieldsDescriptor : SerializableDescriptor> +{ + internal RuntimeFieldFetchFieldsDescriptor(Action> configure) => configure.Invoke(this); + + public RuntimeFieldFetchFieldsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + + public RuntimeFieldFetchFieldsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public RuntimeFieldFetchFieldsDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RuntimeFieldFetchFieldsDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RuntimeFieldFetchFieldsDescriptor : SerializableDescriptor +{ + internal RuntimeFieldFetchFieldsDescriptor(Action configure) => configure.Invoke(this); + + public RuntimeFieldFetchFieldsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + + public RuntimeFieldFetchFieldsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public RuntimeFieldFetchFieldsDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RuntimeFieldFetchFieldsDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RuntimeFieldFetchFieldsDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs new file mode 100644 index 00000000000..6b4be3759f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs @@ -0,0 +1,705 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class ScaledFloatNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public double? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("scaling_factor")] + public double? ScalingFactor { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "scaled_float"; +} + +public sealed partial class ScaledFloatNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ScaledFloatNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ScaledFloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private double? ScalingFactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ScaledFloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ScaledFloatNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor ScalingFactor(double? scalingFactor) + { + ScalingFactorValue = scalingFactor; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScalingFactorValue.HasValue) + { + writer.WritePropertyName("scaling_factor"); + writer.WriteNumberValue(ScalingFactorValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("scaled_float"); + writer.WriteEndObject(); + } + + ScaledFloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + ScalingFactor = ScalingFactorValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class ScaledFloatNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ScaledFloatNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public ScaledFloatNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private double? ScalingFactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ScaledFloatNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ScaledFloatNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor ScalingFactor(double? scalingFactor) + { + ScalingFactorValue = scalingFactor; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScalingFactorValue.HasValue) + { + writer.WritePropertyName("scaling_factor"); + writer.WriteNumberValue(ScalingFactorValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("scaled_float"); + writer.WriteEndObject(); + } + + ScaledFloatNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + ScalingFactor = ScalingFactorValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs new file mode 100644 index 00000000000..dd5d3b7c6b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs @@ -0,0 +1,615 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class SearchAsYouTypeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("max_shingle_size")] + public int? MaxShingleSize { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("norms")] + public bool? Norms { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("search_analyzer")] + public string? SearchAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("search_quote_analyzer")] + public string? SearchQuoteAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("term_vector")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVector { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "search_as_you_type"; +} + +public sealed partial class SearchAsYouTypePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal SearchAsYouTypePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public SearchAsYouTypePropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private int? MaxShingleSizeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + + public SearchAsYouTypePropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public SearchAsYouTypePropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShingleSize) + { + MaxShingleSizeValue = maxShingleSize; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SearchAsYouTypePropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public SearchAsYouTypePropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MaxShingleSizeValue.HasValue) + { + writer.WritePropertyName("max_shingle_size"); + writer.WriteNumberValue(MaxShingleSizeValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("search_as_you_type"); + writer.WriteEndObject(); + } + + SearchAsYouTypeProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + MaxShingleSize = MaxShingleSizeValue, + Meta = MetaValue, + Norms = NormsValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue + }; +} + +public sealed partial class SearchAsYouTypePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SearchAsYouTypePropertyDescriptor(Action configure) => configure.Invoke(this); + + public SearchAsYouTypePropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private int? MaxShingleSizeValue { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + + public SearchAsYouTypePropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public SearchAsYouTypePropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShingleSize) + { + MaxShingleSizeValue = maxShingleSize; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SearchAsYouTypePropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public SearchAsYouTypePropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public SearchAsYouTypePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public SearchAsYouTypePropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (MaxShingleSizeValue.HasValue) + { + writer.WritePropertyName("max_shingle_size"); + writer.WriteNumberValue(MaxShingleSizeValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("search_as_you_type"); + writer.WriteEndObject(); + } + + SearchAsYouTypeProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + CopyTo = CopyToValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + MaxShingleSize = MaxShingleSizeValue, + Meta = MetaValue, + Norms = NormsValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs new file mode 100644 index 00000000000..f9df76b775f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs @@ -0,0 +1,534 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +/// +/// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+///
+public sealed partial class ShapeProperty : IProperty +{ + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("ignore_z_value")] + public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("orientation")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? Orientation { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "shape"; +} + +/// +/// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+///
+public sealed partial class ShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ShapePropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ShapePropertyDescriptor() : base() + { + } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? OrientationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public ShapePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ShapePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ShapePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ShapePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ShapePropertyDescriptor Orientation(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? orientation) + { + OrientationValue = orientation; + return Self; + } + + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ShapePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (OrientationValue is not null) + { + writer.WritePropertyName("orientation"); + JsonSerializer.Serialize(writer, OrientationValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("shape"); + writer.WriteEndObject(); + } + + ShapeProperty IBuildableDescriptor.Build() => new() + { + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + Orientation = OrientationValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +/// +/// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+///
+public sealed partial class ShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ShapePropertyDescriptor(Action configure) => configure.Invoke(this); + + public ShapePropertyDescriptor() : base() + { + } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IgnoreZValueValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? OrientationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public ShapePropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ShapePropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ShapePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ShapePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) + { + IgnoreZValueValue = ignoreZValue; + return Self; + } + + public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ShapePropertyDescriptor Orientation(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoOrientation? orientation) + { + OrientationValue = orientation; + return Self; + } + + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShapePropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ShapePropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IgnoreZValueValue.HasValue) + { + writer.WritePropertyName("ignore_z_value"); + writer.WriteBooleanValue(IgnoreZValueValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (OrientationValue is not null) + { + writer.WritePropertyName("orientation"); + JsonSerializer.Serialize(writer, OrientationValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("shape"); + writer.WriteEndObject(); + } + + ShapeProperty IBuildableDescriptor.Build() => new() + { + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + IgnoreZValue = IgnoreZValueValue, + Meta = MetaValue, + Orientation = OrientationValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs new file mode 100644 index 00000000000..d4865decb5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class ShortNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public double? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "short"; +} + +public sealed partial class ShortNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal ShortNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public ShortNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ShortNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ShortNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ShortNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ShortNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ShortNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ShortNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ShortNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ShortNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ShortNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("short"); + writer.WriteEndObject(); + } + + ShortNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class ShortNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ShortNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public ShortNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public ShortNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public ShortNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public ShortNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public ShortNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public ShortNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public ShortNumberPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public ShortNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public ShortNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public ShortNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public ShortNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue is not null) + { + writer.WritePropertyName("null_value"); + JsonSerializer.Serialize(writer, NullValueValue, options); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("short"); + writer.WriteEndObject(); + } + + ShortNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SizeField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SizeField.g.cs new file mode 100644 index 00000000000..87b37992329 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SizeField.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class SizeField +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class SizeFieldDescriptor : SerializableDescriptor +{ + internal SizeFieldDescriptor(Action configure) => configure.Invoke(this); + + public SizeFieldDescriptor() : base() + { + } + + private bool EnabledValue { get; set; } + + public SizeFieldDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SourceField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SourceField.g.cs new file mode 100644 index 00000000000..a198f729c50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SourceField.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class SourceField +{ + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("compress_threshold")] + public string? CompressThreshold { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("excludes")] + public ICollection? Excludes { get; set; } + [JsonInclude, JsonPropertyName("includes")] + public ICollection? Includes { get; set; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldMode? Mode { get; set; } +} + +public sealed partial class SourceFieldDescriptor : SerializableDescriptor +{ + internal SourceFieldDescriptor(Action configure) => configure.Invoke(this); + + public SourceFieldDescriptor() : base() + { + } + + private bool? CompressValue { get; set; } + private string? CompressThresholdValue { get; set; } + private bool? EnabledValue { get; set; } + private ICollection? ExcludesValue { get; set; } + private ICollection? IncludesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldMode? ModeValue { get; set; } + + public SourceFieldDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public SourceFieldDescriptor CompressThreshold(string? compressThreshold) + { + CompressThresholdValue = compressThreshold; + return Self; + } + + public SourceFieldDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public SourceFieldDescriptor Excludes(ICollection? excludes) + { + ExcludesValue = excludes; + return Self; + } + + public SourceFieldDescriptor Includes(ICollection? includes) + { + IncludesValue = includes; + return Self; + } + + public SourceFieldDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldMode? mode) + { + ModeValue = mode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (!string.IsNullOrEmpty(CompressThresholdValue)) + { + writer.WritePropertyName("compress_threshold"); + writer.WriteStringValue(CompressThresholdValue); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (ExcludesValue is not null) + { + writer.WritePropertyName("excludes"); + JsonSerializer.Serialize(writer, ExcludesValue, options); + } + + if (IncludesValue is not null) + { + writer.WritePropertyName("includes"); + JsonSerializer.Serialize(writer, IncludesValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs new file mode 100644 index 00000000000..0e0151ebab2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs @@ -0,0 +1,178 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class SuggestContext +{ + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name Name { get; set; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } + [JsonInclude, JsonPropertyName("precision")] + public Union? Precision { get; set; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; set; } +} + +public sealed partial class SuggestContextDescriptor : SerializableDescriptor> +{ + internal SuggestContextDescriptor(Action> configure) => configure.Invoke(this); + + public SuggestContextDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + private Union? PrecisionValue { get; set; } + private string TypeValue { get; set; } + + public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + public SuggestContextDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Precision(Union? precision) + { + PrecisionValue = precision; + return Self; + } + + public SuggestContextDescriptor Type(string type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); + writer.WriteEndObject(); + } +} + +public sealed partial class SuggestContextDescriptor : SerializableDescriptor +{ + internal SuggestContextDescriptor(Action configure) => configure.Invoke(this); + + public SuggestContextDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PathValue { get; set; } + private Union? PrecisionValue { get; set; } + private string TypeValue { get; set; } + + public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + public SuggestContextDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Precision(Union? precision) + { + PrecisionValue = precision; + return Self; + } + + public SuggestContextDescriptor Type(string type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + if (PathValue is not null) + { + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs new file mode 100644 index 00000000000..d9e92bc4408 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class TextIndexPrefixes +{ + [JsonInclude, JsonPropertyName("max_chars")] + public int MaxChars { get; set; } + [JsonInclude, JsonPropertyName("min_chars")] + public int MinChars { get; set; } +} + +public sealed partial class TextIndexPrefixesDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal TextIndexPrefixesDescriptor(Action configure) => configure.Invoke(this); + + public TextIndexPrefixesDescriptor() : base() + { + } + + private int MaxCharsValue { get; set; } + private int MinCharsValue { get; set; } + + public TextIndexPrefixesDescriptor MaxChars(int maxChars) + { + MaxCharsValue = maxChars; + return Self; + } + + public TextIndexPrefixesDescriptor MinChars(int minChars) + { + MinCharsValue = minChars; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max_chars"); + writer.WriteNumberValue(MaxCharsValue); + writer.WritePropertyName("min_chars"); + writer.WriteNumberValue(MinCharsValue); + writer.WriteEndObject(); + } + + TextIndexPrefixes IBuildableDescriptor.Build() => new() + { + MaxChars = MaxCharsValue, + MinChars = MinCharsValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs new file mode 100644 index 00000000000..4830a3151e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs @@ -0,0 +1,1011 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class TextProperty : IProperty +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude, JsonPropertyName("fielddata")] + public bool? Fielddata { get; set; } + [JsonInclude, JsonPropertyName("fielddata_frequency_filter")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? FielddataFrequencyFilter { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("index_options")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + [JsonInclude, JsonPropertyName("index_phrases")] + public bool? IndexPhrases { get; set; } + [JsonInclude, JsonPropertyName("index_prefixes")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("norms")] + public bool? Norms { get; set; } + [JsonInclude, JsonPropertyName("position_increment_gap")] + public int? PositionIncrementGap { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("search_analyzer")] + public string? SearchAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("search_quote_analyzer")] + public string? SearchQuoteAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("term_vector")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVector { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "text"; +} + +public sealed partial class TextPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal TextPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public TextPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private bool? FielddataValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? FielddataFrequencyFilterValue { get; set; } + private IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } + private Action FielddataFrequencyFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private bool? IndexPhrasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } + private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private int? PositionIncrementGapValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + + public TextPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TextPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public TextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public TextPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TextPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public TextPropertyDescriptor Fielddata(bool? fielddata = true) + { + FielddataValue = fielddata; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? fielddataFrequencyFilter) + { + FielddataFrequencyFilterDescriptor = null; + FielddataFrequencyFilterDescriptorAction = null; + FielddataFrequencyFilterValue = fielddataFrequencyFilter; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + { + FielddataFrequencyFilterValue = null; + FielddataFrequencyFilterDescriptorAction = null; + FielddataFrequencyFilterDescriptor = descriptor; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + { + FielddataFrequencyFilterValue = null; + FielddataFrequencyFilterDescriptor = null; + FielddataFrequencyFilterDescriptorAction = configure; + return Self; + } + + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public TextPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public TextPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public TextPropertyDescriptor IndexPhrases(bool? indexPhrases = true) + { + IndexPhrasesValue = indexPhrases; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? indexPrefixes) + { + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesValue = indexPrefixes; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesDescriptor = descriptor; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(Action configure) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = configure; + return Self; + } + + public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TextPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public TextPropertyDescriptor PositionIncrementGap(int? positionIncrementGap) + { + PositionIncrementGapValue = positionIncrementGap; + return Self; + } + + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public TextPropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public TextPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public TextPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public TextPropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FielddataValue.HasValue) + { + writer.WritePropertyName("fielddata"); + writer.WriteBooleanValue(FielddataValue.Value); + } + + if (FielddataFrequencyFilterDescriptor is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, FielddataFrequencyFilterDescriptor, options); + } + else if (FielddataFrequencyFilterDescriptorAction is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + } + else if (FielddataFrequencyFilterValue is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, FielddataFrequencyFilterValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (IndexPhrasesValue.HasValue) + { + writer.WritePropertyName("index_phrases"); + writer.WriteBooleanValue(IndexPhrasesValue.Value); + } + + if (IndexPrefixesDescriptor is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesDescriptor, options); + } + else if (IndexPrefixesDescriptorAction is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + } + else if (IndexPrefixesValue is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (PositionIncrementGapValue.HasValue) + { + writer.WritePropertyName("position_increment_gap"); + writer.WriteNumberValue(PositionIncrementGapValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("text"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? BuildFielddataFrequencyFilter() + { + if (FielddataFrequencyFilterValue is not null) + { + return FielddataFrequencyFilterValue; + } + + if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataFrequencyFilterDescriptorAction is not null) + { + var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? BuildIndexPrefixes() + { + if (IndexPrefixesValue is not null) + { + return IndexPrefixesValue; + } + + if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexPrefixesDescriptorAction is not null) + { + var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + TextProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + CopyTo = CopyToValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fielddata = FielddataValue, + FielddataFrequencyFilter = BuildFielddataFrequencyFilter(), + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + IndexPhrases = IndexPhrasesValue, + IndexPrefixes = BuildIndexPrefixes(), + Meta = MetaValue, + Norms = NormsValue, + PositionIncrementGap = PositionIncrementGapValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue + }; +} + +public sealed partial class TextPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal TextPropertyDescriptor(Action configure) => configure.Invoke(this); + + public TextPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private bool? FielddataValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? FielddataFrequencyFilterValue { get; set; } + private IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } + private Action FielddataFrequencyFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptionsValue { get; set; } + private bool? IndexPhrasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } + private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private bool? NormsValue { get; set; } + private int? PositionIncrementGapValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SearchAnalyzerValue { get; set; } + private string? SearchQuoteAnalyzerValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? TermVectorValue { get; set; } + + public TextPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TextPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public TextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public TextPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TextPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + + public TextPropertyDescriptor Fielddata(bool? fielddata = true) + { + FielddataValue = fielddata; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? fielddataFrequencyFilter) + { + FielddataFrequencyFilterDescriptor = null; + FielddataFrequencyFilterDescriptorAction = null; + FielddataFrequencyFilterValue = fielddataFrequencyFilter; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + { + FielddataFrequencyFilterValue = null; + FielddataFrequencyFilterDescriptorAction = null; + FielddataFrequencyFilterDescriptor = descriptor; + return Self; + } + + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + { + FielddataFrequencyFilterValue = null; + FielddataFrequencyFilterDescriptor = null; + FielddataFrequencyFilterDescriptorAction = configure; + return Self; + } + + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public TextPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public TextPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? indexOptions) + { + IndexOptionsValue = indexOptions; + return Self; + } + + public TextPropertyDescriptor IndexPhrases(bool? indexPhrases = true) + { + IndexPhrasesValue = indexPhrases; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? indexPrefixes) + { + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesValue = indexPrefixes; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptorAction = null; + IndexPrefixesDescriptor = descriptor; + return Self; + } + + public TextPropertyDescriptor IndexPrefixes(Action configure) + { + IndexPrefixesValue = null; + IndexPrefixesDescriptor = null; + IndexPrefixesDescriptorAction = configure; + return Self; + } + + public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TextPropertyDescriptor Norms(bool? norms = true) + { + NormsValue = norms; + return Self; + } + + public TextPropertyDescriptor PositionIncrementGap(int? positionIncrementGap) + { + PositionIncrementGapValue = positionIncrementGap; + return Self; + } + + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TextPropertyDescriptor SearchAnalyzer(string? searchAnalyzer) + { + SearchAnalyzerValue = searchAnalyzer; + return Self; + } + + public TextPropertyDescriptor SearchQuoteAnalyzer(string? searchQuoteAnalyzer) + { + SearchQuoteAnalyzerValue = searchQuoteAnalyzer; + return Self; + } + + public TextPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public TextPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public TextPropertyDescriptor TermVector(Elastic.Clients.Elasticsearch.Serverless.Mapping.TermVectorOption? termVector) + { + TermVectorValue = termVector; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + + if (FielddataValue.HasValue) + { + writer.WritePropertyName("fielddata"); + writer.WriteBooleanValue(FielddataValue.Value); + } + + if (FielddataFrequencyFilterDescriptor is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, FielddataFrequencyFilterDescriptor, options); + } + else if (FielddataFrequencyFilterDescriptorAction is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + } + else if (FielddataFrequencyFilterValue is not null) + { + writer.WritePropertyName("fielddata_frequency_filter"); + JsonSerializer.Serialize(writer, FielddataFrequencyFilterValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (IndexOptionsValue is not null) + { + writer.WritePropertyName("index_options"); + JsonSerializer.Serialize(writer, IndexOptionsValue, options); + } + + if (IndexPhrasesValue.HasValue) + { + writer.WritePropertyName("index_phrases"); + writer.WriteBooleanValue(IndexPhrasesValue.Value); + } + + if (IndexPrefixesDescriptor is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesDescriptor, options); + } + else if (IndexPrefixesDescriptorAction is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + } + else if (IndexPrefixesValue is not null) + { + writer.WritePropertyName("index_prefixes"); + JsonSerializer.Serialize(writer, IndexPrefixesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NormsValue.HasValue) + { + writer.WritePropertyName("norms"); + writer.WriteBooleanValue(NormsValue.Value); + } + + if (PositionIncrementGapValue.HasValue) + { + writer.WritePropertyName("position_increment_gap"); + writer.WriteNumberValue(PositionIncrementGapValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SearchAnalyzerValue)) + { + writer.WritePropertyName("search_analyzer"); + writer.WriteStringValue(SearchAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SearchQuoteAnalyzerValue)) + { + writer.WritePropertyName("search_quote_analyzer"); + writer.WriteStringValue(SearchQuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TermVectorValue is not null) + { + writer.WritePropertyName("term_vector"); + JsonSerializer.Serialize(writer, TermVectorValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("text"); + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilter? BuildFielddataFrequencyFilter() + { + if (FielddataFrequencyFilterValue is not null) + { + return FielddataFrequencyFilterValue; + } + + if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (FielddataFrequencyFilterDescriptorAction is not null) + { + var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? BuildIndexPrefixes() + { + if (IndexPrefixesValue is not null) + { + return IndexPrefixesValue; + } + + if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (IndexPrefixesDescriptorAction is not null) + { + var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if (descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + TextProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + CopyTo = CopyToValue, + Dynamic = DynamicValue, + EagerGlobalOrdinals = EagerGlobalOrdinalsValue, + Fielddata = FielddataValue, + FielddataFrequencyFilter = BuildFielddataFrequencyFilter(), + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + IndexOptions = IndexOptionsValue, + IndexPhrases = IndexPhrasesValue, + IndexPrefixes = BuildIndexPrefixes(), + Meta = MetaValue, + Norms = NormsValue, + PositionIncrementGap = PositionIncrementGapValue, + Properties = PropertiesValue, + SearchAnalyzer = SearchAnalyzerValue, + SearchQuoteAnalyzer = SearchQuoteAnalyzerValue, + Similarity = SimilarityValue, + Store = StoreValue, + TermVector = TermVectorValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs new file mode 100644 index 00000000000..b433cd569ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs @@ -0,0 +1,555 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class TokenCountProperty : IProperty +{ + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("enable_position_increments")] + public bool? EnablePositionIncrements { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public double? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "token_count"; +} + +public sealed partial class TokenCountPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal TokenCountPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public TokenCountPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnablePositionIncrementsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public TokenCountPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TokenCountPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public TokenCountPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public TokenCountPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public TokenCountPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TokenCountPropertyDescriptor EnablePositionIncrements(bool? enablePositionIncrements = true) + { + EnablePositionIncrementsValue = enablePositionIncrements; + return Self; + } + + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public TokenCountPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TokenCountPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public TokenCountPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnablePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("enable_position_increments"); + writer.WriteBooleanValue(EnablePositionIncrementsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("token_count"); + writer.WriteEndObject(); + } + + TokenCountProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EnablePositionIncrements = EnablePositionIncrementsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class TokenCountPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal TokenCountPropertyDescriptor(Action configure) => configure.Invoke(this); + + public TokenCountPropertyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private double? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EnablePositionIncrementsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public TokenCountPropertyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public TokenCountPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public TokenCountPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public TokenCountPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public TokenCountPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TokenCountPropertyDescriptor EnablePositionIncrements(bool? enablePositionIncrements = true) + { + EnablePositionIncrementsValue = enablePositionIncrements; + return Self; + } + + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public TokenCountPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TokenCountPropertyDescriptor NullValue(double? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TokenCountPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public TokenCountPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (EnablePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("enable_position_increments"); + writer.WriteBooleanValue(EnablePositionIncrementsValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("token_count"); + writer.WriteEndObject(); + } + + TokenCountProperty IBuildableDescriptor.Build() => new() + { + Analyzer = AnalyzerValue, + Boost = BoostValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + EnablePositionIncrements = EnablePositionIncrementsValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs new file mode 100644 index 00000000000..c4bb339f44f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs @@ -0,0 +1,960 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class TypeMapping +{ + [JsonInclude, JsonPropertyName("_data_stream_timestamp")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? DataStreamTimestamp { get; set; } + [JsonInclude, JsonPropertyName("_field_names")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNames { get; set; } + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? Routing { get; set; } + [JsonInclude, JsonPropertyName("_size")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeField? Size { get; set; } + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? Source { get; set; } + [JsonInclude, JsonPropertyName("all_field")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? AllField { get; set; } + [JsonInclude, JsonPropertyName("date_detection")] + public bool? DateDetection { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("dynamic_date_formats")] + public ICollection? DynamicDateFormats { get; set; } + [JsonInclude, JsonPropertyName("dynamic_templates")] + public ICollection>? DynamicTemplates { get; set; } + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("index_field")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexField { get; set; } + [JsonInclude, JsonPropertyName("numeric_detection")] + public bool? NumericDetection { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("runtime")] + public IDictionary? Runtime { get; set; } +} + +public sealed partial class TypeMappingDescriptor : SerializableDescriptor> +{ + internal TypeMappingDescriptor(Action> configure) => configure.Invoke(this); + + public TypeMappingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? DataStreamTimestampValue { get; set; } + private DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } + private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } + private RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeField? SizeValue { get; set; } + private SizeFieldDescriptor SizeDescriptor { get; set; } + private Action SizeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } + private SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? AllFieldValue { get; set; } + private AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } + private bool? DateDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private ICollection? DynamicDateFormatsValue { get; set; } + private ICollection>? DynamicTemplatesValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexFieldValue { get; set; } + private IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } + private bool? NumericDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary? RuntimeValue { get; set; } + + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? dataStreamTimestamp) + { + DataStreamTimestampDescriptor = null; + DataStreamTimestampDescriptorAction = null; + DataStreamTimestampValue = dataStreamTimestamp; + return Self; + } + + public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + { + DataStreamTimestampValue = null; + DataStreamTimestampDescriptorAction = null; + DataStreamTimestampDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor DataStreamTimestamp(Action configure) + { + DataStreamTimestampValue = null; + DataStreamTimestampDescriptor = null; + DataStreamTimestampDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? fieldNames) + { + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = null; + FieldNamesValue = fieldNames; + return Self; + } + + public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + { + FieldNamesValue = null; + FieldNamesDescriptorAction = null; + FieldNamesDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor FieldNames(Action configure) + { + FieldNamesValue = null; + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeField? size) + { + SizeDescriptor = null; + SizeDescriptorAction = null; + SizeValue = size; + return Self; + } + + public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + { + SizeValue = null; + SizeDescriptorAction = null; + SizeDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Size(Action configure) + { + SizeValue = null; + SizeDescriptor = null; + SizeDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? allField) + { + AllFieldDescriptor = null; + AllFieldDescriptorAction = null; + AllFieldValue = allField; + return Self; + } + + public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + { + AllFieldValue = null; + AllFieldDescriptorAction = null; + AllFieldDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor AllField(Action configure) + { + AllFieldValue = null; + AllFieldDescriptor = null; + AllFieldDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor DateDetection(bool? dateDetection = true) + { + DateDetectionValue = dateDetection; + return Self; + } + + public TypeMappingDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TypeMappingDescriptor DynamicDateFormats(ICollection? dynamicDateFormats) + { + DynamicDateFormatsValue = dynamicDateFormats; + return Self; + } + + public TypeMappingDescriptor DynamicTemplates(ICollection>? dynamicTemplates) + { + DynamicTemplatesValue = dynamicTemplates; + return Self; + } + + public TypeMappingDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? indexField) + { + IndexFieldDescriptor = null; + IndexFieldDescriptorAction = null; + IndexFieldValue = indexField; + return Self; + } + + public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + { + IndexFieldValue = null; + IndexFieldDescriptorAction = null; + IndexFieldDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor IndexField(Action configure) + { + IndexFieldValue = null; + IndexFieldDescriptor = null; + IndexFieldDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor NumericDetection(bool? numericDetection = true) + { + NumericDetectionValue = numericDetection; + return Self; + } + + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TypeMappingDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + { + RuntimeValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DataStreamTimestampDescriptor is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, DataStreamTimestampDescriptor, options); + } + else if (DataStreamTimestampDescriptorAction is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + } + else if (DataStreamTimestampValue is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, DataStreamTimestampValue, options); + } + + if (FieldNamesDescriptor is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesDescriptor, options); + } + else if (FieldNamesDescriptorAction is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + } + else if (FieldNamesValue is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SizeDescriptor is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, SizeDescriptor, options); + } + else if (SizeDescriptorAction is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + } + else if (SizeValue is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, SizeValue, options); + } + + if (SourceDescriptor is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceDescriptor, options); + } + else if (SourceDescriptorAction is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (AllFieldDescriptor is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, AllFieldDescriptor, options); + } + else if (AllFieldDescriptorAction is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + } + else if (AllFieldValue is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, AllFieldValue, options); + } + + if (DateDetectionValue.HasValue) + { + writer.WritePropertyName("date_detection"); + writer.WriteBooleanValue(DateDetectionValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (DynamicDateFormatsValue is not null) + { + writer.WritePropertyName("dynamic_date_formats"); + JsonSerializer.Serialize(writer, DynamicDateFormatsValue, options); + } + + if (DynamicTemplatesValue is not null) + { + writer.WritePropertyName("dynamic_templates"); + JsonSerializer.Serialize(writer, DynamicTemplatesValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (IndexFieldDescriptor is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, IndexFieldDescriptor, options); + } + else if (IndexFieldDescriptorAction is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + } + else if (IndexFieldValue is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, IndexFieldValue, options); + } + + if (NumericDetectionValue.HasValue) + { + writer.WritePropertyName("numeric_detection"); + writer.WriteBooleanValue(NumericDetectionValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RuntimeValue is not null) + { + writer.WritePropertyName("runtime"); + JsonSerializer.Serialize(writer, RuntimeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TypeMappingDescriptor : SerializableDescriptor +{ + internal TypeMappingDescriptor(Action configure) => configure.Invoke(this); + + public TypeMappingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? DataStreamTimestampValue { get; set; } + private DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } + private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } + private RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeField? SizeValue { get; set; } + private SizeFieldDescriptor SizeDescriptor { get; set; } + private Action SizeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } + private SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? AllFieldValue { get; set; } + private AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } + private bool? DateDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private ICollection? DynamicDateFormatsValue { get; set; } + private ICollection>? DynamicTemplatesValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexFieldValue { get; set; } + private IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } + private bool? NumericDetectionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private IDictionary? RuntimeValue { get; set; } + + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? dataStreamTimestamp) + { + DataStreamTimestampDescriptor = null; + DataStreamTimestampDescriptorAction = null; + DataStreamTimestampValue = dataStreamTimestamp; + return Self; + } + + public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + { + DataStreamTimestampValue = null; + DataStreamTimestampDescriptorAction = null; + DataStreamTimestampDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor DataStreamTimestamp(Action configure) + { + DataStreamTimestampValue = null; + DataStreamTimestampDescriptor = null; + DataStreamTimestampDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? fieldNames) + { + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = null; + FieldNamesValue = fieldNames; + return Self; + } + + public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + { + FieldNamesValue = null; + FieldNamesDescriptorAction = null; + FieldNamesDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor FieldNames(Action configure) + { + FieldNamesValue = null; + FieldNamesDescriptor = null; + FieldNamesDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? routing) + { + RoutingDescriptor = null; + RoutingDescriptorAction = null; + RoutingValue = routing; + return Self; + } + + public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + { + RoutingValue = null; + RoutingDescriptorAction = null; + RoutingDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Routing(Action configure) + { + RoutingValue = null; + RoutingDescriptor = null; + RoutingDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeField? size) + { + SizeDescriptor = null; + SizeDescriptorAction = null; + SizeValue = size; + return Self; + } + + public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + { + SizeValue = null; + SizeDescriptorAction = null; + SizeDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Size(Action configure) + { + SizeValue = null; + SizeDescriptor = null; + SizeDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? allField) + { + AllFieldDescriptor = null; + AllFieldDescriptorAction = null; + AllFieldValue = allField; + return Self; + } + + public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + { + AllFieldValue = null; + AllFieldDescriptorAction = null; + AllFieldDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor AllField(Action configure) + { + AllFieldValue = null; + AllFieldDescriptor = null; + AllFieldDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor DateDetection(bool? dateDetection = true) + { + DateDetectionValue = dateDetection; + return Self; + } + + public TypeMappingDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public TypeMappingDescriptor DynamicDateFormats(ICollection? dynamicDateFormats) + { + DynamicDateFormatsValue = dynamicDateFormats; + return Self; + } + + public TypeMappingDescriptor DynamicTemplates(ICollection>? dynamicTemplates) + { + DynamicTemplatesValue = dynamicTemplates; + return Self; + } + + public TypeMappingDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? indexField) + { + IndexFieldDescriptor = null; + IndexFieldDescriptorAction = null; + IndexFieldValue = indexField; + return Self; + } + + public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + { + IndexFieldValue = null; + IndexFieldDescriptorAction = null; + IndexFieldDescriptor = descriptor; + return Self; + } + + public TypeMappingDescriptor IndexField(Action configure) + { + IndexFieldValue = null; + IndexFieldDescriptor = null; + IndexFieldDescriptorAction = configure; + return Self; + } + + public TypeMappingDescriptor NumericDetection(bool? numericDetection = true) + { + NumericDetectionValue = numericDetection; + return Self; + } + + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TypeMappingDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + { + RuntimeValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DataStreamTimestampDescriptor is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, DataStreamTimestampDescriptor, options); + } + else if (DataStreamTimestampDescriptorAction is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + } + else if (DataStreamTimestampValue is not null) + { + writer.WritePropertyName("_data_stream_timestamp"); + JsonSerializer.Serialize(writer, DataStreamTimestampValue, options); + } + + if (FieldNamesDescriptor is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesDescriptor, options); + } + else if (FieldNamesDescriptorAction is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + } + else if (FieldNamesValue is not null) + { + writer.WritePropertyName("_field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RoutingDescriptor is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingDescriptor, options); + } + else if (RoutingDescriptorAction is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + } + else if (RoutingValue is not null) + { + writer.WritePropertyName("_routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SizeDescriptor is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, SizeDescriptor, options); + } + else if (SizeDescriptorAction is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + } + else if (SizeValue is not null) + { + writer.WritePropertyName("_size"); + JsonSerializer.Serialize(writer, SizeValue, options); + } + + if (SourceDescriptor is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceDescriptor, options); + } + else if (SourceDescriptorAction is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (AllFieldDescriptor is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, AllFieldDescriptor, options); + } + else if (AllFieldDescriptorAction is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + } + else if (AllFieldValue is not null) + { + writer.WritePropertyName("all_field"); + JsonSerializer.Serialize(writer, AllFieldValue, options); + } + + if (DateDetectionValue.HasValue) + { + writer.WritePropertyName("date_detection"); + writer.WriteBooleanValue(DateDetectionValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (DynamicDateFormatsValue is not null) + { + writer.WritePropertyName("dynamic_date_formats"); + JsonSerializer.Serialize(writer, DynamicDateFormatsValue, options); + } + + if (DynamicTemplatesValue is not null) + { + writer.WritePropertyName("dynamic_templates"); + JsonSerializer.Serialize(writer, DynamicTemplatesValue, options); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (IndexFieldDescriptor is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, IndexFieldDescriptor, options); + } + else if (IndexFieldDescriptorAction is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + } + else if (IndexFieldValue is not null) + { + writer.WritePropertyName("index_field"); + JsonSerializer.Serialize(writer, IndexFieldValue, options); + } + + if (NumericDetectionValue.HasValue) + { + writer.WritePropertyName("numeric_detection"); + writer.WriteBooleanValue(NumericDetectionValue.Value); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (RuntimeValue is not null) + { + writer.WritePropertyName("runtime"); + JsonSerializer.Serialize(writer, RuntimeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs new file mode 100644 index 00000000000..95df92ca167 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs @@ -0,0 +1,675 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class UnsignedLongNumberProperty : IProperty +{ + [JsonInclude, JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude, JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("ignore_malformed")] + public bool? IgnoreMalformed { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public long? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + [JsonInclude, JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude, JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "unsigned_long"; +} + +public sealed partial class UnsignedLongNumberPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal UnsignedLongNumberPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public UnsignedLongNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public UnsignedLongNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public UnsignedLongNumberPropertyDescriptor NullValue(long? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("unsigned_long"); + writer.WriteEndObject(); + } + + UnsignedLongNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} + +public sealed partial class UnsignedLongNumberPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal UnsignedLongNumberPropertyDescriptor(Action configure) => configure.Invoke(this); + + public UnsignedLongNumberPropertyDescriptor() : base() + { + } + + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private bool? IgnoreMalformedValue { get; set; } + private bool? IndexValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + + public UnsignedLongNumberPropertyDescriptor Boost(double? boost) + { + BoostValue = boost; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) + { + IgnoreMalformedValue = ignoreMalformed; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public UnsignedLongNumberPropertyDescriptor NullValue(long? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Serverless.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (IgnoreMalformedValue.HasValue) + { + writer.WritePropertyName("ignore_malformed"); + writer.WriteBooleanValue(IgnoreMalformedValue.Value); + } + + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (NullValueValue.HasValue) + { + writer.WritePropertyName("null_value"); + writer.WriteNumberValue(NullValueValue.Value); + } + + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("unsigned_long"); + writer.WriteEndObject(); + } + + UnsignedLongNumberProperty IBuildableDescriptor.Build() => new() + { + Boost = BoostValue, + Coerce = CoerceValue, + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + IgnoreMalformed = IgnoreMalformedValue, + Index = IndexValue, + Meta = MetaValue, + NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, + Properties = PropertiesValue, + Script = ScriptValue, + Similarity = SimilarityValue, + Store = StoreValue, + TimeSeriesDimension = TimeSeriesDimensionValue, + TimeSeriesMetric = TimeSeriesMetricValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs new file mode 100644 index 00000000000..50c12819e5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs @@ -0,0 +1,405 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class VersionProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "version"; +} + +public sealed partial class VersionPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal VersionPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public VersionPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public VersionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public VersionPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public VersionPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public VersionPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("version"); + writer.WriteEndObject(); + } + + VersionProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class VersionPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal VersionPropertyDescriptor(Action configure) => configure.Invoke(this); + + public VersionPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public VersionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public VersionPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public VersionPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public VersionPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public VersionPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("version"); + writer.WriteEndObject(); + } + + VersionProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs new file mode 100644 index 00000000000..7367d4fbe0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs @@ -0,0 +1,435 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; + +public sealed partial class WildcardProperty : IProperty +{ + [JsonInclude, JsonPropertyName("copy_to")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; } + [JsonInclude, JsonPropertyName("doc_values")] + public bool? DocValues { get; set; } + [JsonInclude, JsonPropertyName("dynamic")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } + [JsonInclude, JsonPropertyName("ignore_above")] + public int? IgnoreAbove { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("null_value")] + public string? NullValue { get; set; } + [JsonInclude, JsonPropertyName("properties")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("similarity")] + public string? Similarity { get; set; } + [JsonInclude, JsonPropertyName("store")] + public bool? Store { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "wildcard"; +} + +public sealed partial class WildcardPropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor +{ + internal WildcardPropertyDescriptor(Action> configure) => configure.Invoke(this); + + public WildcardPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public WildcardPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public WildcardPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public WildcardPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public WildcardPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public WildcardPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("wildcard"); + writer.WriteEndObject(); + } + + WildcardProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} + +public sealed partial class WildcardPropertyDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal WildcardPropertyDescriptor(Action configure) => configure.Invoke(this); + + public WildcardPropertyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Fields? CopyToValue { get; set; } + private bool? DocValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } + private int? IgnoreAboveValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } + private string? SimilarityValue { get; set; } + private bool? StoreValue { get; set; } + + public WildcardPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Serverless.Fields? copyTo) + { + CopyToValue = copyTo; + return Self; + } + + public WildcardPropertyDescriptor DocValues(bool? docValues = true) + { + DocValuesValue = docValues; + return Self; + } + + public WildcardPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) + { + DynamicValue = dynamic; + return Self; + } + + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? fields) + { + FieldsValue = fields; + return Self; + } + + public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + { + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Fields(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + FieldsValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) + { + IgnoreAboveValue = ignoreAbove; + return Self; + } + + public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public WildcardPropertyDescriptor NullValue(string? nullValue) + { + NullValueValue = nullValue; + return Self; + } + + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) + { + PropertiesValue = properties; + return Self; + } + + public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + { + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Properties(Action> configure) + { + var descriptor = new PropertiesDescriptor(); + configure?.Invoke(descriptor); + PropertiesValue = descriptor.PromisedValue; + return Self; + } + + public WildcardPropertyDescriptor Similarity(string? similarity) + { + SimilarityValue = similarity; + return Self; + } + + public WildcardPropertyDescriptor Store(bool? store = true) + { + StoreValue = store; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CopyToValue is not null) + { + writer.WritePropertyName("copy_to"); + JsonSerializer.Serialize(writer, CopyToValue, options); + } + + if (DocValuesValue.HasValue) + { + writer.WritePropertyName("doc_values"); + writer.WriteBooleanValue(DocValuesValue.Value); + } + + if (DynamicValue is not null) + { + writer.WritePropertyName("dynamic"); + JsonSerializer.Serialize(writer, DynamicValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IgnoreAboveValue.HasValue) + { + writer.WritePropertyName("ignore_above"); + writer.WriteNumberValue(IgnoreAboveValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NullValueValue)) + { + writer.WritePropertyName("null_value"); + writer.WriteStringValue(NullValueValue); + } + + if (PropertiesValue is not null) + { + writer.WritePropertyName("properties"); + JsonSerializer.Serialize(writer, PropertiesValue, options); + } + + if (!string.IsNullOrEmpty(SimilarityValue)) + { + writer.WritePropertyName("similarity"); + writer.WriteStringValue(SimilarityValue); + } + + if (StoreValue.HasValue) + { + writer.WritePropertyName("store"); + writer.WriteBooleanValue(StoreValue.Value); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("wildcard"); + writer.WriteEndObject(); + } + + WildcardProperty IBuildableDescriptor.Build() => new() + { + CopyTo = CopyToValue, + DocValues = DocValuesValue, + Dynamic = DynamicValue, + Fields = FieldsValue, + IgnoreAbove = IgnoreAboveValue, + Meta = MetaValue, + NullValue = NullValueValue, + Properties = PropertiesValue, + Similarity = SimilarityValue, + Store = StoreValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MergesStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MergesStats.g.cs new file mode 100644 index 00000000000..753e79b1df6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MergesStats.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class MergesStats +{ + [JsonInclude, JsonPropertyName("current")] + public long Current { get; init; } + [JsonInclude, JsonPropertyName("current_docs")] + public long CurrentDocs { get; init; } + [JsonInclude, JsonPropertyName("current_size")] + public string? CurrentSize { get; init; } + [JsonInclude, JsonPropertyName("current_size_in_bytes")] + public long CurrentSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_auto_throttle")] + public string? TotalAutoThrottle { get; init; } + [JsonInclude, JsonPropertyName("total_auto_throttle_in_bytes")] + public long TotalAutoThrottleInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_docs")] + public long TotalDocs { get; init; } + [JsonInclude, JsonPropertyName("total_size")] + public string? TotalSize { get; init; } + [JsonInclude, JsonPropertyName("total_size_in_bytes")] + public long TotalSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_stopped_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalStoppedTime { get; init; } + [JsonInclude, JsonPropertyName("total_stopped_time_in_millis")] + public long TotalStoppedTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_throttled_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalThrottledTime { get; init; } + [JsonInclude, JsonPropertyName("total_throttled_time_in_millis")] + public long TotalThrottledTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs new file mode 100644 index 00000000000..bf0dad73d7a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs @@ -0,0 +1,157 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class ClassificationInferenceOptions +{ + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + [JsonInclude, JsonPropertyName("num_top_feature_importance_values")] + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false. + /// + [JsonInclude, JsonPropertyName("prediction_field_type")] + public string? PredictionFieldType { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// Specifies the field to which the top classes are written. Defaults to top_classes. + /// + [JsonInclude, JsonPropertyName("top_classes_results_field")] + public string? TopClassesResultsField { get; set; } +} + +public sealed partial class ClassificationInferenceOptionsDescriptor : SerializableDescriptor +{ + internal ClassificationInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public ClassificationInferenceOptionsDescriptor() : base() + { + } + + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private string? PredictionFieldTypeValue { get; set; } + private string? ResultsFieldValue { get; set; } + private string? TopClassesResultsFieldValue { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public ClassificationInferenceOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public ClassificationInferenceOptionsDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false. + /// + public ClassificationInferenceOptionsDescriptor PredictionFieldType(string? predictionFieldType) + { + PredictionFieldTypeValue = predictionFieldType; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public ClassificationInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Specifies the field to which the top classes are written. Defaults to top_classes. + /// + public ClassificationInferenceOptionsDescriptor TopClassesResultsField(string? topClassesResultsField) + { + TopClassesResultsFieldValue = topClassesResultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (!string.IsNullOrEmpty(PredictionFieldTypeValue)) + { + writer.WritePropertyName("prediction_field_type"); + writer.WriteStringValue(PredictionFieldTypeValue); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (!string.IsNullOrEmpty(TopClassesResultsFieldValue)) + { + writer.WritePropertyName("top_classes_results_field"); + writer.WriteStringValue(TopClassesResultsFieldValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs new file mode 100644 index 00000000000..4001647f1f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs @@ -0,0 +1,173 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Fill mask inference options +/// +public sealed partial class FillMaskInferenceOptions +{ + /// + /// The string/token which will be removed from incoming documents and replaced with the inference prediction(s).
In a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer
has a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests.
However, if this field is present in a request, its value must match the predefined value for that model/tokenizer,
otherwise the request will fail.
+ ///
+ [JsonInclude, JsonPropertyName("mask_token")] + public string? MaskToken { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(FillMaskInferenceOptions fillMaskInferenceOptions) => Ml.InferenceConfigCreate.FillMask(fillMaskInferenceOptions); +} + +/// +/// Fill mask inference options +/// +public sealed partial class FillMaskInferenceOptionsDescriptor : SerializableDescriptor +{ + internal FillMaskInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public FillMaskInferenceOptionsDescriptor() : base() + { + } + + private string? MaskTokenValue { get; set; } + private int? NumTopClassesValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The string/token which will be removed from incoming documents and replaced with the inference prediction(s).
In a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer
has a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests.
However, if this field is present in a request, its value must match the predefined value for that model/tokenizer,
otherwise the request will fail.
+ ///
+ public FillMaskInferenceOptionsDescriptor MaskToken(string? maskToken) + { + MaskTokenValue = maskToken; + return Self; + } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public FillMaskInferenceOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public FillMaskInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public FillMaskInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public FillMaskInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(MaskTokenValue)) + { + writer.WritePropertyName("mask_token"); + writer.WriteStringValue(MaskTokenValue); + } + + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..50763d528b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs @@ -0,0 +1,145 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class FillMaskInferenceUpdateOptions +{ + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Ml.InferenceConfigUpdate.FillMask(fillMaskInferenceUpdateOptions); +} + +public sealed partial class FillMaskInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal FillMaskInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public FillMaskInferenceUpdateOptionsDescriptor() : base() + { + } + + private int? NumTopClassesValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public FillMaskInferenceUpdateOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public FillMaskInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs new file mode 100644 index 00000000000..d4799ebefd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs @@ -0,0 +1,345 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +[JsonConverter(typeof(InferenceConfigCreateConverter))] +/// +/// Inference configuration provided when storing the model config +/// +public sealed partial class InferenceConfigCreate +{ + internal InferenceConfigCreate(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static InferenceConfigCreate Classification(Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigCreate("classification", classificationInferenceOptions); + public static InferenceConfigCreate FillMask(Elastic.Clients.Elasticsearch.Serverless.Ml.FillMaskInferenceOptions fillMaskInferenceOptions) => new InferenceConfigCreate("fill_mask", fillMaskInferenceOptions); + public static InferenceConfigCreate Ner(Elastic.Clients.Elasticsearch.Serverless.Ml.NerInferenceOptions nerInferenceOptions) => new InferenceConfigCreate("ner", nerInferenceOptions); + public static InferenceConfigCreate PassThrough(Elastic.Clients.Elasticsearch.Serverless.Ml.PassThroughInferenceOptions passThroughInferenceOptions) => new InferenceConfigCreate("pass_through", passThroughInferenceOptions); + public static InferenceConfigCreate QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.Ml.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => new InferenceConfigCreate("question_answering", questionAnsweringInferenceOptions); + public static InferenceConfigCreate Regression(Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigCreate("regression", regressionInferenceOptions); + public static InferenceConfigCreate TextClassification(Elastic.Clients.Elasticsearch.Serverless.Ml.TextClassificationInferenceOptions textClassificationInferenceOptions) => new InferenceConfigCreate("text_classification", textClassificationInferenceOptions); + public static InferenceConfigCreate TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.Ml.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => new InferenceConfigCreate("text_embedding", textEmbeddingInferenceOptions); + public static InferenceConfigCreate TextExpansion(Elastic.Clients.Elasticsearch.Serverless.Ml.TextExpansionInferenceOptions textExpansionInferenceOptions) => new InferenceConfigCreate("text_expansion", textExpansionInferenceOptions); + public static InferenceConfigCreate ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.Ml.ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => new InferenceConfigCreate("zero_shot_classification", zeroShotClassificationInferenceOptions); +} + +internal sealed partial class InferenceConfigCreateConverter : JsonConverter +{ + public override InferenceConfigCreate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "fill_mask") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "ner") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "pass_through") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "question_answering") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "regression") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "text_classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "text_embedding") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "text_expansion") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + if (propertyName == "zero_shot_classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigCreate(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, InferenceConfigCreate value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.FillMaskInferenceOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.NerInferenceOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.PassThroughInferenceOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.QuestionAnsweringInferenceOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextClassificationInferenceOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextEmbeddingInferenceOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextExpansionInferenceOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.ZeroShotClassificationInferenceOptions)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigCreateDescriptor : SerializableDescriptor> +{ + internal InferenceConfigCreateDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigCreateDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigCreateDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigCreateDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigCreateDescriptor Classification(ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Set(zeroShotClassificationInferenceOptions, "zero_shot_classification"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Action configure) => Set(configure, "zero_shot_classification"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigCreateDescriptor : SerializableDescriptor +{ + internal InferenceConfigCreateDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigCreateDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigCreateDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigCreateDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigCreateDescriptor Classification(ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Set(zeroShotClassificationInferenceOptions, "zero_shot_classification"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Action configure) => Set(configure, "zero_shot_classification"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs new file mode 100644 index 00000000000..93fe55a919c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs @@ -0,0 +1,342 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +[JsonConverter(typeof(InferenceConfigUpdateConverter))] +public sealed partial class InferenceConfigUpdate +{ + internal InferenceConfigUpdate(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static InferenceConfigUpdate Classification(Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigUpdate("classification", classificationInferenceOptions); + public static InferenceConfigUpdate FillMask(Elastic.Clients.Elasticsearch.Serverless.Ml.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => new InferenceConfigUpdate("fill_mask", fillMaskInferenceUpdateOptions); + public static InferenceConfigUpdate Ner(Elastic.Clients.Elasticsearch.Serverless.Ml.NerInferenceUpdateOptions nerInferenceUpdateOptions) => new InferenceConfigUpdate("ner", nerInferenceUpdateOptions); + public static InferenceConfigUpdate PassThrough(Elastic.Clients.Elasticsearch.Serverless.Ml.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => new InferenceConfigUpdate("pass_through", passThroughInferenceUpdateOptions); + public static InferenceConfigUpdate QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.Ml.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => new InferenceConfigUpdate("question_answering", questionAnsweringInferenceUpdateOptions); + public static InferenceConfigUpdate Regression(Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigUpdate("regression", regressionInferenceOptions); + public static InferenceConfigUpdate TextClassification(Elastic.Clients.Elasticsearch.Serverless.Ml.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("text_classification", textClassificationInferenceUpdateOptions); + public static InferenceConfigUpdate TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.Ml.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => new InferenceConfigUpdate("text_embedding", textEmbeddingInferenceUpdateOptions); + public static InferenceConfigUpdate TextExpansion(Elastic.Clients.Elasticsearch.Serverless.Ml.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => new InferenceConfigUpdate("text_expansion", textExpansionInferenceUpdateOptions); + public static InferenceConfigUpdate ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.Ml.ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("zero_shot_classification", zeroShotClassificationInferenceUpdateOptions); +} + +internal sealed partial class InferenceConfigUpdateConverter : JsonConverter +{ + public override InferenceConfigUpdate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "fill_mask") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "ner") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "pass_through") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "question_answering") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "regression") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "text_classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "text_embedding") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "text_expansion") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + if (propertyName == "zero_shot_classification") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new InferenceConfigUpdate(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, InferenceConfigUpdate value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.FillMaskInferenceUpdateOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.NerInferenceUpdateOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.PassThroughInferenceUpdateOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.QuestionAnsweringInferenceUpdateOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextClassificationInferenceUpdateOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextEmbeddingInferenceUpdateOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.TextExpansionInferenceUpdateOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.ZeroShotClassificationInferenceUpdateOptions)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigUpdateDescriptor : SerializableDescriptor> +{ + internal InferenceConfigUpdateDescriptor(Action> configure) => configure.Invoke(this); + + public InferenceConfigUpdateDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigUpdateDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigUpdateDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigUpdateDescriptor Classification(ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Set(zeroShotClassificationInferenceUpdateOptions, "zero_shot_classification"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Action configure) => Set(configure, "zero_shot_classification"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class InferenceConfigUpdateDescriptor : SerializableDescriptor +{ + internal InferenceConfigUpdateDescriptor(Action configure) => configure.Invoke(this); + + public InferenceConfigUpdateDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private InferenceConfigUpdateDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private InferenceConfigUpdateDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public InferenceConfigUpdateDescriptor Classification(ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Set(zeroShotClassificationInferenceUpdateOptions, "zero_shot_classification"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Action configure) => Set(configure, "zero_shot_classification"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs new file mode 100644 index 00000000000..fa72abac9cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Named entity recognition options +/// +public sealed partial class NerInferenceOptions +{ + /// + /// The token classification labels. Must be IOB formatted tags + /// + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + [JsonInclude, JsonPropertyName("vocabulary")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? Vocabulary { get; set; } + + public static implicit operator InferenceConfigCreate(NerInferenceOptions nerInferenceOptions) => Ml.InferenceConfigCreate.Ner(nerInferenceOptions); +} + +/// +/// Named entity recognition options +/// +public sealed partial class NerInferenceOptionsDescriptor : SerializableDescriptor +{ + internal NerInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public NerInferenceOptionsDescriptor() : base() + { + } + + private ICollection? ClassificationLabelsValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? VocabularyValue { get; set; } + private VocabularyDescriptor VocabularyDescriptor { get; set; } + private Action VocabularyDescriptorAction { get; set; } + + /// + /// The token classification labels. Must be IOB formatted tags + /// + public NerInferenceOptionsDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public NerInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options + /// + public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public NerInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public NerInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + public NerInferenceOptionsDescriptor Vocabulary(Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? vocabulary) + { + VocabularyDescriptor = null; + VocabularyDescriptorAction = null; + VocabularyValue = vocabulary; + return Self; + } + + public NerInferenceOptionsDescriptor Vocabulary(VocabularyDescriptor descriptor) + { + VocabularyValue = null; + VocabularyDescriptorAction = null; + VocabularyDescriptor = descriptor; + return Self; + } + + public NerInferenceOptionsDescriptor Vocabulary(Action configure) + { + VocabularyValue = null; + VocabularyDescriptor = null; + VocabularyDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClassificationLabelsValue is not null) + { + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + if (VocabularyDescriptor is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, VocabularyDescriptor, options); + } + else if (VocabularyDescriptorAction is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + } + else if (VocabularyValue is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, VocabularyValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..f15c9748910 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class NerInferenceUpdateOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Ml.InferenceConfigUpdate.Ner(nerInferenceUpdateOptions); +} + +public sealed partial class NerInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal NerInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public NerInferenceUpdateOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public NerInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public NerInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public NerInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs new file mode 100644 index 00000000000..23a13df5edd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs @@ -0,0 +1,163 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// BERT and MPNet tokenization configuration options +/// +public sealed partial class NlpBertTokenizationConfig +{ + /// + /// Should the tokenizer lower case the text + /// + [JsonInclude, JsonPropertyName("do_lower_case")] + public bool? DoLowerCase { get; set; } + + /// + /// Maximum input sequence length for the model + /// + [JsonInclude, JsonPropertyName("max_sequence_length")] + public int? MaxSequenceLength { get; set; } + + /// + /// Tokenization spanning options. Special value of -1 indicates no spanning takes place + /// + [JsonInclude, JsonPropertyName("span")] + public int? Span { get; set; } + + /// + /// Should tokenization input be automatically truncated before sending to the model for inference + /// + [JsonInclude, JsonPropertyName("truncate")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? Truncate { get; set; } + + /// + /// Is tokenization completed with special tokens + /// + [JsonInclude, JsonPropertyName("with_special_tokens")] + public bool? WithSpecialTokens { get; set; } +} + +/// +/// BERT and MPNet tokenization configuration options +/// +public sealed partial class NlpBertTokenizationConfigDescriptor : SerializableDescriptor +{ + internal NlpBertTokenizationConfigDescriptor(Action configure) => configure.Invoke(this); + + public NlpBertTokenizationConfigDescriptor() : base() + { + } + + private bool? DoLowerCaseValue { get; set; } + private int? MaxSequenceLengthValue { get; set; } + private int? SpanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? TruncateValue { get; set; } + private bool? WithSpecialTokensValue { get; set; } + + /// + /// Should the tokenizer lower case the text + /// + public NlpBertTokenizationConfigDescriptor DoLowerCase(bool? doLowerCase = true) + { + DoLowerCaseValue = doLowerCase; + return Self; + } + + /// + /// Maximum input sequence length for the model + /// + public NlpBertTokenizationConfigDescriptor MaxSequenceLength(int? maxSequenceLength) + { + MaxSequenceLengthValue = maxSequenceLength; + return Self; + } + + /// + /// Tokenization spanning options. Special value of -1 indicates no spanning takes place + /// + public NlpBertTokenizationConfigDescriptor Span(int? span) + { + SpanValue = span; + return Self; + } + + /// + /// Should tokenization input be automatically truncated before sending to the model for inference + /// + public NlpBertTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + { + TruncateValue = truncate; + return Self; + } + + /// + /// Is tokenization completed with special tokens + /// + public NlpBertTokenizationConfigDescriptor WithSpecialTokens(bool? withSpecialTokens = true) + { + WithSpecialTokensValue = withSpecialTokens; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DoLowerCaseValue.HasValue) + { + writer.WritePropertyName("do_lower_case"); + writer.WriteBooleanValue(DoLowerCaseValue.Value); + } + + if (MaxSequenceLengthValue.HasValue) + { + writer.WritePropertyName("max_sequence_length"); + writer.WriteNumberValue(MaxSequenceLengthValue.Value); + } + + if (SpanValue.HasValue) + { + writer.WritePropertyName("span"); + writer.WriteNumberValue(SpanValue.Value); + } + + if (TruncateValue is not null) + { + writer.WritePropertyName("truncate"); + JsonSerializer.Serialize(writer, TruncateValue, options); + } + + if (WithSpecialTokensValue.HasValue) + { + writer.WritePropertyName("with_special_tokens"); + writer.WriteBooleanValue(WithSpecialTokensValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs new file mode 100644 index 00000000000..9210d45eda4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// RoBERTa tokenization configuration options +/// +public sealed partial class NlpRobertaTokenizationConfig +{ + /// + /// Should the tokenizer prefix input with a space character + /// + [JsonInclude, JsonPropertyName("add_prefix_space")] + public bool? AddPrefixSpace { get; set; } + + /// + /// Maximum input sequence length for the model + /// + [JsonInclude, JsonPropertyName("max_sequence_length")] + public int? MaxSequenceLength { get; set; } + + /// + /// Tokenization spanning options. Special value of -1 indicates no spanning takes place + /// + [JsonInclude, JsonPropertyName("span")] + public int? Span { get; set; } + + /// + /// Should tokenization input be automatically truncated before sending to the model for inference + /// + [JsonInclude, JsonPropertyName("truncate")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? Truncate { get; set; } + + /// + /// Is tokenization completed with special tokens + /// + [JsonInclude, JsonPropertyName("with_special_tokens")] + public bool? WithSpecialTokens { get; set; } + + public static implicit operator TokenizationConfig(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Ml.TokenizationConfig.Roberta(nlpRobertaTokenizationConfig); +} + +/// +/// RoBERTa tokenization configuration options +/// +public sealed partial class NlpRobertaTokenizationConfigDescriptor : SerializableDescriptor +{ + internal NlpRobertaTokenizationConfigDescriptor(Action configure) => configure.Invoke(this); + + public NlpRobertaTokenizationConfigDescriptor() : base() + { + } + + private bool? AddPrefixSpaceValue { get; set; } + private int? MaxSequenceLengthValue { get; set; } + private int? SpanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? TruncateValue { get; set; } + private bool? WithSpecialTokensValue { get; set; } + + /// + /// Should the tokenizer prefix input with a space character + /// + public NlpRobertaTokenizationConfigDescriptor AddPrefixSpace(bool? addPrefixSpace = true) + { + AddPrefixSpaceValue = addPrefixSpace; + return Self; + } + + /// + /// Maximum input sequence length for the model + /// + public NlpRobertaTokenizationConfigDescriptor MaxSequenceLength(int? maxSequenceLength) + { + MaxSequenceLengthValue = maxSequenceLength; + return Self; + } + + /// + /// Tokenization spanning options. Special value of -1 indicates no spanning takes place + /// + public NlpRobertaTokenizationConfigDescriptor Span(int? span) + { + SpanValue = span; + return Self; + } + + /// + /// Should tokenization input be automatically truncated before sending to the model for inference + /// + public NlpRobertaTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + { + TruncateValue = truncate; + return Self; + } + + /// + /// Is tokenization completed with special tokens + /// + public NlpRobertaTokenizationConfigDescriptor WithSpecialTokens(bool? withSpecialTokens = true) + { + WithSpecialTokensValue = withSpecialTokens; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AddPrefixSpaceValue.HasValue) + { + writer.WritePropertyName("add_prefix_space"); + writer.WriteBooleanValue(AddPrefixSpaceValue.Value); + } + + if (MaxSequenceLengthValue.HasValue) + { + writer.WritePropertyName("max_sequence_length"); + writer.WriteNumberValue(MaxSequenceLengthValue.Value); + } + + if (SpanValue.HasValue) + { + writer.WritePropertyName("span"); + writer.WriteNumberValue(SpanValue.Value); + } + + if (TruncateValue is not null) + { + writer.WritePropertyName("truncate"); + JsonSerializer.Serialize(writer, TruncateValue, options); + } + + if (WithSpecialTokensValue.HasValue) + { + writer.WritePropertyName("with_special_tokens"); + writer.WriteBooleanValue(WithSpecialTokensValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs new file mode 100644 index 00000000000..517405c7188 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs @@ -0,0 +1,91 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class NlpTokenizationUpdateOptions +{ + /// + /// Span options to apply + /// + [JsonInclude, JsonPropertyName("span")] + public int? Span { get; set; } + + /// + /// Truncate options to apply + /// + [JsonInclude, JsonPropertyName("truncate")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? Truncate { get; set; } +} + +public sealed partial class NlpTokenizationUpdateOptionsDescriptor : SerializableDescriptor +{ + internal NlpTokenizationUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public NlpTokenizationUpdateOptionsDescriptor() : base() + { + } + + private int? SpanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? TruncateValue { get; set; } + + /// + /// Span options to apply + /// + public NlpTokenizationUpdateOptionsDescriptor Span(int? span) + { + SpanValue = span; + return Self; + } + + /// + /// Truncate options to apply + /// + public NlpTokenizationUpdateOptionsDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + { + TruncateValue = truncate; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SpanValue.HasValue) + { + writer.WritePropertyName("span"); + writer.WriteNumberValue(SpanValue.Value); + } + + if (TruncateValue is not null) + { + writer.WritePropertyName("truncate"); + JsonSerializer.Serialize(writer, TruncateValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs new file mode 100644 index 00000000000..93fd9a47d7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs @@ -0,0 +1,174 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Pass through configuration options +/// +public sealed partial class PassThroughInferenceOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + [JsonInclude, JsonPropertyName("vocabulary")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? Vocabulary { get; set; } + + public static implicit operator InferenceConfigCreate(PassThroughInferenceOptions passThroughInferenceOptions) => Ml.InferenceConfigCreate.PassThrough(passThroughInferenceOptions); +} + +/// +/// Pass through configuration options +/// +public sealed partial class PassThroughInferenceOptionsDescriptor : SerializableDescriptor +{ + internal PassThroughInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public PassThroughInferenceOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? VocabularyValue { get; set; } + private VocabularyDescriptor VocabularyDescriptor { get; set; } + private Action VocabularyDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public PassThroughInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options + /// + public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public PassThroughInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + public PassThroughInferenceOptionsDescriptor Vocabulary(Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? vocabulary) + { + VocabularyDescriptor = null; + VocabularyDescriptorAction = null; + VocabularyValue = vocabulary; + return Self; + } + + public PassThroughInferenceOptionsDescriptor Vocabulary(VocabularyDescriptor descriptor) + { + VocabularyValue = null; + VocabularyDescriptorAction = null; + VocabularyDescriptor = descriptor; + return Self; + } + + public PassThroughInferenceOptionsDescriptor Vocabulary(Action configure) + { + VocabularyValue = null; + VocabularyDescriptor = null; + VocabularyDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + if (VocabularyDescriptor is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, VocabularyDescriptor, options); + } + else if (VocabularyDescriptorAction is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + } + else if (VocabularyValue is not null) + { + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, VocabularyValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..20827e49aa2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class PassThroughInferenceUpdateOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Ml.InferenceConfigUpdate.PassThrough(passThroughInferenceUpdateOptions); +} + +public sealed partial class PassThroughInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal PassThroughInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public PassThroughInferenceUpdateOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public PassThroughInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs new file mode 100644 index 00000000000..ac7ea6c1b44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs @@ -0,0 +1,173 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Question answering inference options +/// +public sealed partial class QuestionAnsweringInferenceOptions +{ + /// + /// The maximum answer length to consider + /// + [JsonInclude, JsonPropertyName("max_answer_length")] + public int? MaxAnswerLength { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Ml.InferenceConfigCreate.QuestionAnswering(questionAnsweringInferenceOptions); +} + +/// +/// Question answering inference options +/// +public sealed partial class QuestionAnsweringInferenceOptionsDescriptor : SerializableDescriptor +{ + internal QuestionAnsweringInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public QuestionAnsweringInferenceOptionsDescriptor() : base() + { + } + + private int? MaxAnswerLengthValue { get; set; } + private int? NumTopClassesValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The maximum answer length to consider + /// + public QuestionAnsweringInferenceOptionsDescriptor MaxAnswerLength(int? maxAnswerLength) + { + MaxAnswerLengthValue = maxAnswerLength; + return Self; + } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public QuestionAnsweringInferenceOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public QuestionAnsweringInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxAnswerLengthValue.HasValue) + { + writer.WritePropertyName("max_answer_length"); + writer.WriteNumberValue(MaxAnswerLengthValue.Value); + } + + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..371f73f2df4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs @@ -0,0 +1,185 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class QuestionAnsweringInferenceUpdateOptions +{ + /// + /// The maximum answer length to consider for extraction + /// + [JsonInclude, JsonPropertyName("max_answer_length")] + public int? MaxAnswerLength { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The question to answer given the inference context + /// + [JsonInclude, JsonPropertyName("question")] + public string Question { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Ml.InferenceConfigUpdate.QuestionAnswering(questionAnsweringInferenceUpdateOptions); +} + +public sealed partial class QuestionAnsweringInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal QuestionAnsweringInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public QuestionAnsweringInferenceUpdateOptionsDescriptor() : base() + { + } + + private int? MaxAnswerLengthValue { get; set; } + private int? NumTopClassesValue { get; set; } + private string QuestionValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The maximum answer length to consider for extraction + /// + public QuestionAnsweringInferenceUpdateOptionsDescriptor MaxAnswerLength(int? maxAnswerLength) + { + MaxAnswerLengthValue = maxAnswerLength; + return Self; + } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public QuestionAnsweringInferenceUpdateOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The question to answer given the inference context + /// + public QuestionAnsweringInferenceUpdateOptionsDescriptor Question(string question) + { + QuestionValue = question; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public QuestionAnsweringInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxAnswerLengthValue.HasValue) + { + writer.WritePropertyName("max_answer_length"); + writer.WriteNumberValue(MaxAnswerLengthValue.Value); + } + + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + writer.WritePropertyName("question"); + writer.WriteStringValue(QuestionValue); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs new file mode 100644 index 00000000000..10674b2cfca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs @@ -0,0 +1,166 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class RegressionInferenceOptions +{ + /// + /// Specifies the maximum number of feature importance values per document. + /// + [JsonInclude, JsonPropertyName("num_top_feature_importance_values")] + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? ResultsField { get; set; } +} + +public sealed partial class RegressionInferenceOptionsDescriptor : SerializableDescriptor> +{ + internal RegressionInferenceOptionsDescriptor(Action> configure) => configure.Invoke(this); + + public RegressionInferenceOptionsDescriptor() : base() + { + } + + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public RegressionInferenceOptionsDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public RegressionInferenceOptionsDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public RegressionInferenceOptionsDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RegressionInferenceOptionsDescriptor : SerializableDescriptor +{ + internal RegressionInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public RegressionInferenceOptionsDescriptor() : base() + { + } + + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Specifies the maximum number of feature importance values per document. + /// + public RegressionInferenceOptionsDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public RegressionInferenceOptionsDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public RegressionInferenceOptionsDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public RegressionInferenceOptionsDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs new file mode 100644 index 00000000000..d2b2ace09a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs @@ -0,0 +1,173 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Text classification configuration options +/// +public sealed partial class TextClassificationInferenceOptions +{ + /// + /// Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels + /// + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(TextClassificationInferenceOptions textClassificationInferenceOptions) => Ml.InferenceConfigCreate.TextClassification(textClassificationInferenceOptions); +} + +/// +/// Text classification configuration options +/// +public sealed partial class TextClassificationInferenceOptionsDescriptor : SerializableDescriptor +{ + internal TextClassificationInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextClassificationInferenceOptionsDescriptor() : base() + { + } + + private ICollection? ClassificationLabelsValue { get; set; } + private int? NumTopClassesValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels + /// + public TextClassificationInferenceOptionsDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public TextClassificationInferenceOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextClassificationInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options + /// + public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextClassificationInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClassificationLabelsValue is not null) + { + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + } + + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..b92176aa494 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs @@ -0,0 +1,167 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class TextClassificationInferenceUpdateOptions +{ + /// + /// Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels + /// + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("num_top_classes")] + public int? NumTopClasses { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextClassification(textClassificationInferenceUpdateOptions); +} + +public sealed partial class TextClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal TextClassificationInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextClassificationInferenceUpdateOptionsDescriptor() : base() + { + } + + private ICollection? ClassificationLabelsValue { get; set; } + private int? NumTopClassesValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels + /// + public TextClassificationInferenceUpdateOptionsDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + /// + /// Specifies the number of top class predictions to return. Defaults to 0. + /// + public TextClassificationInferenceUpdateOptionsDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextClassificationInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClassificationLabelsValue is not null) + { + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + } + + if (NumTopClassesValue.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(NumTopClassesValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs new file mode 100644 index 00000000000..ed67cce0ec6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Text embedding inference options +/// +public sealed partial class TextEmbeddingInferenceOptions +{ + /// + /// The number of dimensions in the embedding output + /// + [JsonInclude, JsonPropertyName("embedding_size")] + public int? EmbeddingSize { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Ml.InferenceConfigCreate.TextEmbedding(textEmbeddingInferenceOptions); +} + +/// +/// Text embedding inference options +/// +public sealed partial class TextEmbeddingInferenceOptionsDescriptor : SerializableDescriptor +{ + internal TextEmbeddingInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextEmbeddingInferenceOptionsDescriptor() : base() + { + } + + private int? EmbeddingSizeValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The number of dimensions in the embedding output + /// + public TextEmbeddingInferenceOptionsDescriptor EmbeddingSize(int? embeddingSize) + { + EmbeddingSizeValue = embeddingSize; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextEmbeddingInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options + /// + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextEmbeddingInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EmbeddingSizeValue.HasValue) + { + writer.WritePropertyName("embedding_size"); + writer.WriteNumberValue(EmbeddingSizeValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..47ef9d7ce08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs @@ -0,0 +1,116 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class TextEmbeddingInferenceUpdateOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextEmbedding(textEmbeddingInferenceUpdateOptions); +} + +public sealed partial class TextEmbeddingInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal TextEmbeddingInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextEmbeddingInferenceUpdateOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextEmbeddingInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs new file mode 100644 index 00000000000..0443be8ce3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs @@ -0,0 +1,129 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Text expansion inference options +/// +public sealed partial class TextExpansionInferenceOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(TextExpansionInferenceOptions textExpansionInferenceOptions) => Ml.InferenceConfigCreate.TextExpansion(textExpansionInferenceOptions); +} + +/// +/// Text expansion inference options +/// +public sealed partial class TextExpansionInferenceOptionsDescriptor : SerializableDescriptor +{ + internal TextExpansionInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextExpansionInferenceOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextExpansionInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options + /// + public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextExpansionInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextExpansionInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..9f2cadc7824 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs @@ -0,0 +1,116 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class TextExpansionInferenceUpdateOptions +{ + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextExpansion(textExpansionInferenceUpdateOptions); +} + +public sealed partial class TextExpansionInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal TextExpansionInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public TextExpansionInferenceUpdateOptionsDescriptor() : base() + { + } + + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public TextExpansionInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs new file mode 100644 index 00000000000..0715fc85629 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs @@ -0,0 +1,239 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +[JsonConverter(typeof(TokenizationConfigConverter))] +/// +/// Tokenization options stored in inference configuration +/// +public sealed partial class TokenizationConfig +{ + internal TokenizationConfig(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static TokenizationConfig Bert(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("bert", nlpBertTokenizationConfig); + public static TokenizationConfig Mpnet(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("mpnet", nlpBertTokenizationConfig); + public static TokenizationConfig Roberta(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => new TokenizationConfig("roberta", nlpRobertaTokenizationConfig); +} + +internal sealed partial class TokenizationConfigConverter : JsonConverter +{ + public override TokenizationConfig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "bert") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new TokenizationConfig(propertyName, variant); + } + + if (propertyName == "mpnet") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new TokenizationConfig(propertyName, variant); + } + + if (propertyName == "roberta") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new TokenizationConfig(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, TokenizationConfig value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "bert": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.NlpBertTokenizationConfig)value.Variant, options); + break; + case "mpnet": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.NlpBertTokenizationConfig)value.Variant, options); + break; + case "roberta": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.NlpRobertaTokenizationConfig)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TokenizationConfigDescriptor : SerializableDescriptor> +{ + internal TokenizationConfigDescriptor(Action> configure) => configure.Invoke(this); + + public TokenizationConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private TokenizationConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private TokenizationConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public TokenizationConfigDescriptor Bert(NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class TokenizationConfigDescriptor : SerializableDescriptor +{ + internal TokenizationConfigDescriptor(Action configure) => configure.Invoke(this); + + public TokenizationConfigDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private TokenizationConfigDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private TokenizationConfigDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public TokenizationConfigDescriptor Bert(NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs new file mode 100644 index 00000000000..ecaeb82ed85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class Vocabulary +{ + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } +} + +public sealed partial class VocabularyDescriptor : SerializableDescriptor +{ + internal VocabularyDescriptor(Action configure) => configure.Invoke(this); + + public VocabularyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + + public VocabularyDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs new file mode 100644 index 00000000000..4d630722511 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs @@ -0,0 +1,213 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +/// +/// Zero shot classification configuration options +/// +public sealed partial class ZeroShotClassificationInferenceOptions +{ + /// + /// The zero shot classification labels indicating entailment, neutral, and contradiction
Must contain exactly and only entailment, neutral, and contradiction
+ ///
+ [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection ClassificationLabels { get; set; } + + /// + /// Hypothesis template used when tokenizing labels for prediction + /// + [JsonInclude, JsonPropertyName("hypothesis_template")] + public string? HypothesisTemplate { get; set; } + + /// + /// The labels to predict. + /// + [JsonInclude, JsonPropertyName("labels")] + public ICollection? Labels { get; set; } + + /// + /// Indicates if more than one true label exists. + /// + [JsonInclude, JsonPropertyName("multi_label")] + public bool? MultiLabel { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + + public static implicit operator InferenceConfigCreate(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Ml.InferenceConfigCreate.ZeroShotClassification(zeroShotClassificationInferenceOptions); +} + +/// +/// Zero shot classification configuration options +/// +public sealed partial class ZeroShotClassificationInferenceOptionsDescriptor : SerializableDescriptor +{ + internal ZeroShotClassificationInferenceOptionsDescriptor(Action configure) => configure.Invoke(this); + + public ZeroShotClassificationInferenceOptionsDescriptor() : base() + { + } + + private ICollection ClassificationLabelsValue { get; set; } + private string? HypothesisTemplateValue { get; set; } + private ICollection? LabelsValue { get; set; } + private bool? MultiLabelValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? TokenizationValue { get; set; } + private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The zero shot classification labels indicating entailment, neutral, and contradiction
Must contain exactly and only entailment, neutral, and contradiction
+ ///
+ public ZeroShotClassificationInferenceOptionsDescriptor ClassificationLabels(ICollection classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + /// + /// Hypothesis template used when tokenizing labels for prediction + /// + public ZeroShotClassificationInferenceOptionsDescriptor HypothesisTemplate(string? hypothesisTemplate) + { + HypothesisTemplateValue = hypothesisTemplate; + return Self; + } + + /// + /// The labels to predict. + /// + public ZeroShotClassificationInferenceOptionsDescriptor Labels(ICollection? labels) + { + LabelsValue = labels; + return Self; + } + + /// + /// Indicates if more than one true label exists. + /// + public ZeroShotClassificationInferenceOptionsDescriptor MultiLabel(bool? multiLabel = true) + { + MultiLabelValue = multiLabel; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public ZeroShotClassificationInferenceOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + if (!string.IsNullOrEmpty(HypothesisTemplateValue)) + { + writer.WritePropertyName("hypothesis_template"); + writer.WriteStringValue(HypothesisTemplateValue); + } + + if (LabelsValue is not null) + { + writer.WritePropertyName("labels"); + JsonSerializer.Serialize(writer, LabelsValue, options); + } + + if (MultiLabelValue.HasValue) + { + writer.WritePropertyName("multi_label"); + writer.WriteBooleanValue(MultiLabelValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs new file mode 100644 index 00000000000..5bbe5fe5f25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs @@ -0,0 +1,163 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Ml; + +public sealed partial class ZeroShotClassificationInferenceUpdateOptions +{ + /// + /// The labels to predict. + /// + [JsonInclude, JsonPropertyName("labels")] + public ICollection Labels { get; set; } + + /// + /// Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value. + /// + [JsonInclude, JsonPropertyName("multi_label")] + public bool? MultiLabel { get; set; } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + [JsonInclude, JsonPropertyName("results_field")] + public string? ResultsField { get; set; } + + /// + /// The tokenization options to update when inferring + /// + [JsonInclude, JsonPropertyName("tokenization")] + public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + + public static implicit operator InferenceConfigUpdate(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.ZeroShotClassification(zeroShotClassificationInferenceUpdateOptions); +} + +public sealed partial class ZeroShotClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor +{ + internal ZeroShotClassificationInferenceUpdateOptionsDescriptor(Action configure) => configure.Invoke(this); + + public ZeroShotClassificationInferenceUpdateOptionsDescriptor() : base() + { + } + + private ICollection LabelsValue { get; set; } + private bool? MultiLabelValue { get; set; } + private string? ResultsFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + + /// + /// The labels to predict. + /// + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Labels(ICollection labels) + { + LabelsValue = labels; + return Self; + } + + /// + /// Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value. + /// + public ZeroShotClassificationInferenceUpdateOptionsDescriptor MultiLabel(bool? multiLabel = true) + { + MultiLabelValue = multiLabel; + return Self; + } + + /// + /// The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + /// + public ZeroShotClassificationInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// The tokenization options to update when inferring + /// + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + { + TokenizationDescriptor = null; + TokenizationDescriptorAction = null; + TokenizationValue = tokenization; + return Self; + } + + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + { + TokenizationValue = null; + TokenizationDescriptorAction = null; + TokenizationDescriptor = descriptor; + return Self; + } + + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + { + TokenizationValue = null; + TokenizationDescriptor = null; + TokenizationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("labels"); + JsonSerializer.Serialize(writer, LabelsValue, options); + if (MultiLabelValue.HasValue) + { + writer.WritePropertyName("multi_label"); + writer.WriteBooleanValue(MultiLabelValue.Value); + } + + if (!string.IsNullOrEmpty(ResultsFieldValue)) + { + writer.WritePropertyName("results_field"); + writer.WriteStringValue(ResultsFieldValue); + } + + if (TokenizationDescriptor is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationDescriptor, options); + } + else if (TokenizationDescriptorAction is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + } + else if (TokenizationValue is not null) + { + writer.WritePropertyName("tokenization"); + JsonSerializer.Serialize(writer, TokenizationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs new file mode 100644 index 00000000000..983a4e7dd6f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs @@ -0,0 +1,306 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class NestedSortValue +{ + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + [JsonInclude, JsonPropertyName("max_children")] + public int? MaxChildren { get; set; } + [JsonInclude, JsonPropertyName("nested")] + public Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? Nested { get; set; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Field Path { get; set; } +} + +public sealed partial class NestedSortValueDescriptor : SerializableDescriptor> +{ + internal NestedSortValueDescriptor(Action> configure) => configure.Invoke(this); + + public NestedSortValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } + private int? MaxChildrenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public NestedSortValueDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public NestedSortValueDescriptor Nested(Action> configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public NestedSortValueDescriptor MaxChildren(int? maxChildren) + { + MaxChildrenValue = maxChildren; + return Self; + } + + public NestedSortValueDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + public NestedSortValueDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (MaxChildrenValue.HasValue) + { + writer.WritePropertyName("max_children"); + writer.WriteNumberValue(MaxChildrenValue.Value); + } + + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class NestedSortValueDescriptor : SerializableDescriptor +{ + internal NestedSortValueDescriptor(Action configure) => configure.Invoke(this); + + public NestedSortValueDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } + private int? MaxChildrenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public NestedSortValueDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public NestedSortValueDescriptor Nested(Action configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public NestedSortValueDescriptor MaxChildren(int? maxChildren) + { + MaxChildrenValue = maxChildren; + return Self; + } + + public NestedSortValueDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + public NestedSortValueDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public NestedSortValueDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (MaxChildrenValue.HasValue) + { + writer.WritePropertyName("max_children"); + writer.WriteNumberValue(MaxChildrenValue.Value); + } + + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NodeStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NodeStatistics.g.cs new file mode 100644 index 00000000000..8acd9469b2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NodeStatistics.g.cs @@ -0,0 +1,54 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// Contains statistics about the number of nodes selected by the request. +/// +public sealed partial class NodeStatistics +{ + /// + /// 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. + /// + [JsonInclude, JsonPropertyName("failed")] + public int Failed { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + + /// + /// Number of nodes that responded successfully to the request. + /// + [JsonInclude, JsonPropertyName("successful")] + public int Successful { get; init; } + + /// + /// Total number of nodes selected by the request. + /// + [JsonInclude, JsonPropertyName("total")] + public int Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/PluginStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/PluginStats.g.cs new file mode 100644 index 00000000000..1e8fa0c0962 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/PluginStats.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class PluginStats +{ + [JsonInclude, JsonPropertyName("classname")] + public string Classname { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("elasticsearch_version")] + public string ElasticsearchVersion { get; init; } + [JsonInclude, JsonPropertyName("extended_plugins")] + public IReadOnlyCollection ExtendedPlugins { get; init; } + [JsonInclude, JsonPropertyName("has_native_controller")] + public bool HasNativeController { get; init; } + [JsonInclude, JsonPropertyName("java_version")] + public string JavaVersion { get; init; } + [JsonInclude, JsonPropertyName("licensed")] + public bool Licensed { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryCacheStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryCacheStats.g.cs new file mode 100644 index 00000000000..dabe0fcb06c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryCacheStats.g.cs @@ -0,0 +1,79 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class QueryCacheStats +{ + /// + /// Total number of entries added to the query cache across all shards assigned to selected nodes.
This number includes current and evicted entries.
+ ///
+ [JsonInclude, JsonPropertyName("cache_count")] + public int CacheCount { get; init; } + + /// + /// Total number of entries currently in the query cache across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("cache_size")] + public int CacheSize { get; init; } + + /// + /// Total number of query cache evictions across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("evictions")] + public int Evictions { get; init; } + + /// + /// Total count of query cache hits across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("hit_count")] + public int HitCount { get; init; } + + /// + /// Total amount of memory used for the query cache across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("memory_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MemorySize { get; init; } + + /// + /// Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("memory_size_in_bytes")] + public long MemorySizeInBytes { get; init; } + + /// + /// Total count of query cache misses across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("miss_count")] + public int MissCount { get; init; } + + /// + /// Total count of hits and misses in the query cache across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("total_count")] + public int TotalCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs new file mode 100644 index 00000000000..a331dc7d266 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs @@ -0,0 +1,762 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class BoolQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The clause (query) must appear in matching documents.
However, unlike `must`, the score of the query will be ignored.
+ ///
+ [JsonInclude, JsonPropertyName("filter"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] + public ICollection? Filter { get; set; } + + /// + /// Specifies the number or percentage of `should` clauses returned documents must match. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// The clause (query) must appear in matching documents and will contribute to the score. + /// + [JsonInclude, JsonPropertyName("must"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] + public ICollection? Must { get; set; } + + /// + /// The clause (query) must not appear in the matching documents.
Because scoring is ignored, a score of `0` is returned for all documents.
+ ///
+ [JsonInclude, JsonPropertyName("must_not"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] + public ICollection? MustNot { get; set; } + + /// + /// The clause (query) should appear in the matching document. + /// + [JsonInclude, JsonPropertyName("should"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] + public ICollection? Should { get; set; } + + public static implicit operator Query(BoolQuery boolQuery) => QueryDsl.Query.Bool(boolQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("bool", this); +} + +public sealed partial class BoolQueryDescriptor : SerializableDescriptor> +{ + internal BoolQueryDescriptor(Action> configure) => configure.Invoke(this); + + public BoolQueryDescriptor() : base() + { + } + + private ICollection? FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } + private ICollection? MustValue { get; set; } + private QueryDescriptor MustDescriptor { get; set; } + private Action> MustDescriptorAction { get; set; } + private Action>[] MustDescriptorActions { get; set; } + private ICollection? MustNotValue { get; set; } + private QueryDescriptor MustNotDescriptor { get; set; } + private Action> MustNotDescriptorAction { get; set; } + private Action>[] MustNotDescriptorActions { get; set; } + private ICollection? ShouldValue { get; set; } + private QueryDescriptor ShouldDescriptor { get; set; } + private Action> ShouldDescriptorAction { get; set; } + private Action>[] ShouldDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + + /// + /// The clause (query) must appear in matching documents.
However, unlike `must`, the score of the query will be ignored.
+ ///
+ public BoolQueryDescriptor Filter(ICollection? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterValue = filter; + return Self; + } + + public BoolQueryDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorActions = null; + FilterDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Filter(params Action>[] configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) must appear in matching documents and will contribute to the score. + /// + public BoolQueryDescriptor Must(ICollection? must) + { + MustDescriptor = null; + MustDescriptorAction = null; + MustDescriptorActions = null; + MustValue = must; + return Self; + } + + public BoolQueryDescriptor Must(QueryDescriptor descriptor) + { + MustValue = null; + MustDescriptorAction = null; + MustDescriptorActions = null; + MustDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Must(Action> configure) + { + MustValue = null; + MustDescriptor = null; + MustDescriptorActions = null; + MustDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Must(params Action>[] configure) + { + MustValue = null; + MustDescriptor = null; + MustDescriptorAction = null; + MustDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) must not appear in the matching documents.
Because scoring is ignored, a score of `0` is returned for all documents.
+ ///
+ public BoolQueryDescriptor MustNot(ICollection? mustNot) + { + MustNotDescriptor = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = null; + MustNotValue = mustNot; + return Self; + } + + public BoolQueryDescriptor MustNot(QueryDescriptor descriptor) + { + MustNotValue = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = null; + MustNotDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor MustNot(Action> configure) + { + MustNotValue = null; + MustNotDescriptor = null; + MustNotDescriptorActions = null; + MustNotDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor MustNot(params Action>[] configure) + { + MustNotValue = null; + MustNotDescriptor = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) should appear in the matching document. + /// + public BoolQueryDescriptor Should(ICollection? should) + { + ShouldDescriptor = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = null; + ShouldValue = should; + return Self; + } + + public BoolQueryDescriptor Should(QueryDescriptor descriptor) + { + ShouldValue = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = null; + ShouldDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Should(Action> configure) + { + ShouldValue = null; + ShouldDescriptor = null; + ShouldDescriptorActions = null; + ShouldDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Should(params Action>[] configure) + { + ShouldValue = null; + ShouldDescriptor = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = configure; + return Self; + } + + public BoolQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public BoolQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Specifies the number or percentage of `should` clauses returned documents must match. + /// + public BoolQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterDescriptorActions is not null) + { + writer.WritePropertyName("filter"); + if (FilterDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in FilterDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (FilterDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + SingleOrManySerializationHelper.Serialize(FilterValue, writer, options); + } + + if (MustDescriptor is not null) + { + writer.WritePropertyName("must"); + JsonSerializer.Serialize(writer, MustDescriptor, options); + } + else if (MustDescriptorAction is not null) + { + writer.WritePropertyName("must"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + } + else if (MustDescriptorActions is not null) + { + writer.WritePropertyName("must"); + if (MustDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MustDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (MustDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MustValue is not null) + { + writer.WritePropertyName("must"); + SingleOrManySerializationHelper.Serialize(MustValue, writer, options); + } + + if (MustNotDescriptor is not null) + { + writer.WritePropertyName("must_not"); + JsonSerializer.Serialize(writer, MustNotDescriptor, options); + } + else if (MustNotDescriptorAction is not null) + { + writer.WritePropertyName("must_not"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + } + else if (MustNotDescriptorActions is not null) + { + writer.WritePropertyName("must_not"); + if (MustNotDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MustNotDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (MustNotDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MustNotValue is not null) + { + writer.WritePropertyName("must_not"); + SingleOrManySerializationHelper.Serialize(MustNotValue, writer, options); + } + + if (ShouldDescriptor is not null) + { + writer.WritePropertyName("should"); + JsonSerializer.Serialize(writer, ShouldDescriptor, options); + } + else if (ShouldDescriptorAction is not null) + { + writer.WritePropertyName("should"); + JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + } + else if (ShouldDescriptorActions is not null) + { + writer.WritePropertyName("should"); + if (ShouldDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in ShouldDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (ShouldDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (ShouldValue is not null) + { + writer.WritePropertyName("should"); + SingleOrManySerializationHelper.Serialize(ShouldValue, writer, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class BoolQueryDescriptor : SerializableDescriptor +{ + internal BoolQueryDescriptor(Action configure) => configure.Invoke(this); + + public BoolQueryDescriptor() : base() + { + } + + private ICollection? FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } + private ICollection? MustValue { get; set; } + private QueryDescriptor MustDescriptor { get; set; } + private Action MustDescriptorAction { get; set; } + private Action[] MustDescriptorActions { get; set; } + private ICollection? MustNotValue { get; set; } + private QueryDescriptor MustNotDescriptor { get; set; } + private Action MustNotDescriptorAction { get; set; } + private Action[] MustNotDescriptorActions { get; set; } + private ICollection? ShouldValue { get; set; } + private QueryDescriptor ShouldDescriptor { get; set; } + private Action ShouldDescriptorAction { get; set; } + private Action[] ShouldDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + + /// + /// The clause (query) must appear in matching documents.
However, unlike `must`, the score of the query will be ignored.
+ ///
+ public BoolQueryDescriptor Filter(ICollection? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterValue = filter; + return Self; + } + + public BoolQueryDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptorActions = null; + FilterDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorActions = null; + FilterDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Filter(params Action[] configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) must appear in matching documents and will contribute to the score. + /// + public BoolQueryDescriptor Must(ICollection? must) + { + MustDescriptor = null; + MustDescriptorAction = null; + MustDescriptorActions = null; + MustValue = must; + return Self; + } + + public BoolQueryDescriptor Must(QueryDescriptor descriptor) + { + MustValue = null; + MustDescriptorAction = null; + MustDescriptorActions = null; + MustDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Must(Action configure) + { + MustValue = null; + MustDescriptor = null; + MustDescriptorActions = null; + MustDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Must(params Action[] configure) + { + MustValue = null; + MustDescriptor = null; + MustDescriptorAction = null; + MustDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) must not appear in the matching documents.
Because scoring is ignored, a score of `0` is returned for all documents.
+ ///
+ public BoolQueryDescriptor MustNot(ICollection? mustNot) + { + MustNotDescriptor = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = null; + MustNotValue = mustNot; + return Self; + } + + public BoolQueryDescriptor MustNot(QueryDescriptor descriptor) + { + MustNotValue = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = null; + MustNotDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor MustNot(Action configure) + { + MustNotValue = null; + MustNotDescriptor = null; + MustNotDescriptorActions = null; + MustNotDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor MustNot(params Action[] configure) + { + MustNotValue = null; + MustNotDescriptor = null; + MustNotDescriptorAction = null; + MustNotDescriptorActions = configure; + return Self; + } + + /// + /// The clause (query) should appear in the matching document. + /// + public BoolQueryDescriptor Should(ICollection? should) + { + ShouldDescriptor = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = null; + ShouldValue = should; + return Self; + } + + public BoolQueryDescriptor Should(QueryDescriptor descriptor) + { + ShouldValue = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = null; + ShouldDescriptor = descriptor; + return Self; + } + + public BoolQueryDescriptor Should(Action configure) + { + ShouldValue = null; + ShouldDescriptor = null; + ShouldDescriptorActions = null; + ShouldDescriptorAction = configure; + return Self; + } + + public BoolQueryDescriptor Should(params Action[] configure) + { + ShouldValue = null; + ShouldDescriptor = null; + ShouldDescriptorAction = null; + ShouldDescriptorActions = configure; + return Self; + } + + public BoolQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public BoolQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Specifies the number or percentage of `should` clauses returned documents must match. + /// + public BoolQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterDescriptorActions is not null) + { + writer.WritePropertyName("filter"); + if (FilterDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in FilterDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (FilterDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + SingleOrManySerializationHelper.Serialize(FilterValue, writer, options); + } + + if (MustDescriptor is not null) + { + writer.WritePropertyName("must"); + JsonSerializer.Serialize(writer, MustDescriptor, options); + } + else if (MustDescriptorAction is not null) + { + writer.WritePropertyName("must"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + } + else if (MustDescriptorActions is not null) + { + writer.WritePropertyName("must"); + if (MustDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MustDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (MustDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MustValue is not null) + { + writer.WritePropertyName("must"); + SingleOrManySerializationHelper.Serialize(MustValue, writer, options); + } + + if (MustNotDescriptor is not null) + { + writer.WritePropertyName("must_not"); + JsonSerializer.Serialize(writer, MustNotDescriptor, options); + } + else if (MustNotDescriptorAction is not null) + { + writer.WritePropertyName("must_not"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + } + else if (MustNotDescriptorActions is not null) + { + writer.WritePropertyName("must_not"); + if (MustNotDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in MustNotDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (MustNotDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (MustNotValue is not null) + { + writer.WritePropertyName("must_not"); + SingleOrManySerializationHelper.Serialize(MustNotValue, writer, options); + } + + if (ShouldDescriptor is not null) + { + writer.WritePropertyName("should"); + JsonSerializer.Serialize(writer, ShouldDescriptor, options); + } + else if (ShouldDescriptorAction is not null) + { + writer.WritePropertyName("should"); + JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + } + else if (ShouldDescriptorActions is not null) + { + writer.WritePropertyName("should"); + if (ShouldDescriptorActions.Length > 1) + writer.WriteStartArray(); + foreach (var action in ShouldDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + if (ShouldDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (ShouldValue is not null) + { + writer.WritePropertyName("should"); + SingleOrManySerializationHelper.Serialize(ShouldValue, writer, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs new file mode 100644 index 00000000000..1a8afc0fd43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs @@ -0,0 +1,350 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class BoostingQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Query used to decrease the relevance score of matching documents. + /// + [JsonInclude, JsonPropertyName("negative")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Negative { get; set; } + + /// + /// Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query. + /// + [JsonInclude, JsonPropertyName("negative_boost")] + public double NegativeBoost { get; set; } + + /// + /// Any returned documents must match this query. + /// + [JsonInclude, JsonPropertyName("positive")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Positive { get; set; } + + public static implicit operator Query(BoostingQuery boostingQuery) => QueryDsl.Query.Boosting(boostingQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("boosting", this); +} + +public sealed partial class BoostingQueryDescriptor : SerializableDescriptor> +{ + internal BoostingQueryDescriptor(Action> configure) => configure.Invoke(this); + + public BoostingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query NegativeValue { get; set; } + private QueryDescriptor NegativeDescriptor { get; set; } + private Action> NegativeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query PositiveValue { get; set; } + private QueryDescriptor PositiveDescriptor { get; set; } + private Action> PositiveDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private double NegativeBoostValue { get; set; } + + /// + /// Query used to decrease the relevance score of matching documents. + /// + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query negative) + { + NegativeDescriptor = null; + NegativeDescriptorAction = null; + NegativeValue = negative; + return Self; + } + + public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + { + NegativeValue = null; + NegativeDescriptorAction = null; + NegativeDescriptor = descriptor; + return Self; + } + + public BoostingQueryDescriptor Negative(Action> configure) + { + NegativeValue = null; + NegativeDescriptor = null; + NegativeDescriptorAction = configure; + return Self; + } + + /// + /// Any returned documents must match this query. + /// + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query positive) + { + PositiveDescriptor = null; + PositiveDescriptorAction = null; + PositiveValue = positive; + return Self; + } + + public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + { + PositiveValue = null; + PositiveDescriptorAction = null; + PositiveDescriptor = descriptor; + return Self; + } + + public BoostingQueryDescriptor Positive(Action> configure) + { + PositiveValue = null; + PositiveDescriptor = null; + PositiveDescriptorAction = configure; + return Self; + } + + public BoostingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public BoostingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query. + /// + public BoostingQueryDescriptor NegativeBoost(double negativeBoost) + { + NegativeBoostValue = negativeBoost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NegativeDescriptor is not null) + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, NegativeDescriptor, options); + } + else if (NegativeDescriptorAction is not null) + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + } + else + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, NegativeValue, options); + } + + if (PositiveDescriptor is not null) + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, PositiveDescriptor, options); + } + else if (PositiveDescriptorAction is not null) + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + } + else + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, PositiveValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("negative_boost"); + writer.WriteNumberValue(NegativeBoostValue); + writer.WriteEndObject(); + } +} + +public sealed partial class BoostingQueryDescriptor : SerializableDescriptor +{ + internal BoostingQueryDescriptor(Action configure) => configure.Invoke(this); + + public BoostingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query NegativeValue { get; set; } + private QueryDescriptor NegativeDescriptor { get; set; } + private Action NegativeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query PositiveValue { get; set; } + private QueryDescriptor PositiveDescriptor { get; set; } + private Action PositiveDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private double NegativeBoostValue { get; set; } + + /// + /// Query used to decrease the relevance score of matching documents. + /// + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query negative) + { + NegativeDescriptor = null; + NegativeDescriptorAction = null; + NegativeValue = negative; + return Self; + } + + public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + { + NegativeValue = null; + NegativeDescriptorAction = null; + NegativeDescriptor = descriptor; + return Self; + } + + public BoostingQueryDescriptor Negative(Action configure) + { + NegativeValue = null; + NegativeDescriptor = null; + NegativeDescriptorAction = configure; + return Self; + } + + /// + /// Any returned documents must match this query. + /// + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query positive) + { + PositiveDescriptor = null; + PositiveDescriptorAction = null; + PositiveValue = positive; + return Self; + } + + public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + { + PositiveValue = null; + PositiveDescriptorAction = null; + PositiveDescriptor = descriptor; + return Self; + } + + public BoostingQueryDescriptor Positive(Action configure) + { + PositiveValue = null; + PositiveDescriptor = null; + PositiveDescriptorAction = configure; + return Self; + } + + public BoostingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public BoostingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query. + /// + public BoostingQueryDescriptor NegativeBoost(double negativeBoost) + { + NegativeBoostValue = negativeBoost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NegativeDescriptor is not null) + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, NegativeDescriptor, options); + } + else if (NegativeDescriptorAction is not null) + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + } + else + { + writer.WritePropertyName("negative"); + JsonSerializer.Serialize(writer, NegativeValue, options); + } + + if (PositiveDescriptor is not null) + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, PositiveDescriptor, options); + } + else if (PositiveDescriptorAction is not null) + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + } + else + { + writer.WritePropertyName("positive"); + JsonSerializer.Serialize(writer, PositiveValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("negative_boost"); + writer.WriteNumberValue(NegativeBoostValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs new file mode 100644 index 00000000000..3db426f64fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs @@ -0,0 +1,336 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class CombinedFieldsQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// If true, match phrase queries are automatically created for multi-term synonyms. + /// + [JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] + public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`. + /// + [JsonInclude, JsonPropertyName("fields")] + public Fields Fields { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Boolean logic used to interpret text in the query value. + /// + [JsonInclude, JsonPropertyName("operator")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? Operator { get; set; } + + /// + /// Text to search for in the provided `fields`.
The `combined_fields` query analyzes the provided text before performing a search.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + [JsonInclude, JsonPropertyName("zero_terms_query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsZeroTerms? ZeroTermsQuery { get; set; } + + public static implicit operator Query(CombinedFieldsQuery combinedFieldsQuery) => QueryDsl.Query.CombinedFields(combinedFieldsQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("combined_fields", this); +} + +public sealed partial class CombinedFieldsQueryDescriptor : SerializableDescriptor> +{ + internal CombinedFieldsQueryDescriptor(Action> configure) => configure.Invoke(this); + + public CombinedFieldsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Fields FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? OperatorValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsZeroTerms? ZeroTermsQueryValue { get; set; } + + public CombinedFieldsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If true, match phrase queries are automatically created for multi-term synonyms. + /// + public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public CombinedFieldsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`. + /// + public CombinedFieldsQueryDescriptor Fields(Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Text to search for in the provided `fields`.
The `combined_fields` query analyzes the provided text before performing a search.
+ ///
+ public CombinedFieldsQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + public CombinedFieldsQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsZeroTerms? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CombinedFieldsQueryDescriptor : SerializableDescriptor +{ + internal CombinedFieldsQueryDescriptor(Action configure) => configure.Invoke(this); + + public CombinedFieldsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Fields FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? OperatorValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsZeroTerms? ZeroTermsQueryValue { get; set; } + + public CombinedFieldsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If true, match phrase queries are automatically created for multi-term synonyms. + /// + public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public CombinedFieldsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`. + /// + public CombinedFieldsQueryDescriptor Fields(Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Text to search for in the provided `fields`.
The `combined_fields` query analyzes the provided text before performing a search.
+ ///
+ public CombinedFieldsQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + public CombinedFieldsQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsZeroTerms? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs new file mode 100644 index 00000000000..88316ed570a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs @@ -0,0 +1,222 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ConstantScoreQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Filter query you wish to run. Any returned documents must match this query.
Filter queries do not calculate relevance scores.
To speed up performance, Elasticsearch automatically caches frequently used filter queries.
+ ///
+ [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Filter { get; set; } + + public static implicit operator Query(ConstantScoreQuery constantScoreQuery) => QueryDsl.Query.ConstantScore(constantScoreQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("constant_score", this); +} + +public sealed partial class ConstantScoreQueryDescriptor : SerializableDescriptor> +{ + internal ConstantScoreQueryDescriptor(Action> configure) => configure.Invoke(this); + + public ConstantScoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Filter query you wish to run. Any returned documents must match this query.
Filter queries do not calculate relevance scores.
To speed up performance, Elasticsearch automatically caches frequently used filter queries.
+ ///
+ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public ConstantScoreQueryDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public ConstantScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ConstantScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ConstantScoreQueryDescriptor : SerializableDescriptor +{ + internal ConstantScoreQueryDescriptor(Action configure) => configure.Invoke(this); + + public ConstantScoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Filter query you wish to run. Any returned documents must match this query.
Filter queries do not calculate relevance scores.
To speed up performance, Elasticsearch automatically caches frequently used filter queries.
+ ///
+ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public ConstantScoreQueryDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public ConstantScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ConstantScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs new file mode 100644 index 00000000000..bfb0e44e904 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -0,0 +1,668 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class DateRangeQueryConverter : JsonConverter +{ + public override DateRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new DateRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "format") + { + variant.Format = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "time_zone") + { + variant.TimeZone = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, DateRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize DateRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.Format is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, value.Format, options); + } + + if (value.From is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, value.From, options); + } + + if (value.Gt is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, value.Gt, options); + } + + if (value.Gte is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, value.Gte, options); + } + + if (value.Lt is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, value.Lt, options); + } + + if (value.Lte is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, value.Lte, options); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (value.TimeZone is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, value.TimeZone, options); + } + + if (value.To is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, value.To, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(DateRangeQueryConverter))] +public sealed partial class DateRangeQuery : RangeQuery +{ + public DateRangeQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Date format used to convert `date` values in the query. + /// + public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.DateMath? From { get; set; } + + /// + /// Greater than. + /// + public Elastic.Clients.Elasticsearch.Serverless.DateMath? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public Elastic.Clients.Elasticsearch.Serverless.DateMath? Gte { get; set; } + + /// + /// Less than. + /// + public Elastic.Clients.Elasticsearch.Serverless.DateMath? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public Elastic.Clients.Elasticsearch.Serverless.DateMath? Lte { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? Relation { get; set; } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public string? TimeZone { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.DateMath? To { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(DateRangeQuery dateRangeQuery) => QueryDsl.Query.Range(dateRangeQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("range", this); +} + +public sealed partial class DateRangeQueryDescriptor : SerializableDescriptor> +{ + internal DateRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal DateRangeQueryDescriptor() : base() + { + } + + public DateRangeQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public DateRangeQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? FromValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? GtValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? GteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? LtValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? LteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? ToValue { get; set; } + + public DateRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public DateRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public DateRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DateRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public DateRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangeQueryDescriptor From(Elastic.Clients.Elasticsearch.Serverless.DateMath? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public DateRangeQueryDescriptor Gt(Elastic.Clients.Elasticsearch.Serverless.DateMath? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public DateRangeQueryDescriptor Gte(Elastic.Clients.Elasticsearch.Serverless.DateMath? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public DateRangeQueryDescriptor Lt(Elastic.Clients.Elasticsearch.Serverless.DateMath? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public DateRangeQueryDescriptor Lte(Elastic.Clients.Elasticsearch.Serverless.DateMath? lte) + { + LteValue = lte; + return Self; + } + + public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public DateRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public DateRangeQueryDescriptor To(Elastic.Clients.Elasticsearch.Serverless.DateMath? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class DateRangeQueryDescriptor : SerializableDescriptor +{ + internal DateRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + internal DateRangeQueryDescriptor() : base() + { + } + + public DateRangeQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? FromValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? GtValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? GteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? LtValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? LteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath? ToValue { get; set; } + + public DateRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public DateRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public DateRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DateRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public DateRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateRangeQueryDescriptor From(Elastic.Clients.Elasticsearch.Serverless.DateMath? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public DateRangeQueryDescriptor Gt(Elastic.Clients.Elasticsearch.Serverless.DateMath? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public DateRangeQueryDescriptor Gte(Elastic.Clients.Elasticsearch.Serverless.DateMath? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public DateRangeQueryDescriptor Lt(Elastic.Clients.Elasticsearch.Serverless.DateMath? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public DateRangeQueryDescriptor Lte(Elastic.Clients.Elasticsearch.Serverless.DateMath? lte) + { + LteValue = lte; + return Self; + } + + public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public DateRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public DateRangeQueryDescriptor To(Elastic.Clients.Elasticsearch.Serverless.DateMath? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FormatValue is not null) + { + writer.WritePropertyName("format"); + JsonSerializer.Serialize(writer, FormatValue, options); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs new file mode 100644 index 00000000000..bd9aa307dc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs @@ -0,0 +1,316 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class DisMaxQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// One or more query clauses.
Returned documents must match one or more of these queries.
If a document matches multiple queries, Elasticsearch uses the highest relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("queries")] + public ICollection Queries { get; set; } + + /// + /// Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. + /// + [JsonInclude, JsonPropertyName("tie_breaker")] + public double? TieBreaker { get; set; } + + public static implicit operator Query(DisMaxQuery disMaxQuery) => QueryDsl.Query.DisMax(disMaxQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("dis_max", this); +} + +public sealed partial class DisMaxQueryDescriptor : SerializableDescriptor> +{ + internal DisMaxQueryDescriptor(Action> configure) => configure.Invoke(this); + + public DisMaxQueryDescriptor() : base() + { + } + + private ICollection QueriesValue { get; set; } + private QueryDescriptor QueriesDescriptor { get; set; } + private Action> QueriesDescriptorAction { get; set; } + private Action>[] QueriesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private double? TieBreakerValue { get; set; } + + /// + /// One or more query clauses.
Returned documents must match one or more of these queries.
If a document matches multiple queries, Elasticsearch uses the highest relevance score.
+ ///
+ public DisMaxQueryDescriptor Queries(ICollection queries) + { + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = null; + QueriesValue = queries; + return Self; + } + + public DisMaxQueryDescriptor Queries(QueryDescriptor descriptor) + { + QueriesValue = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = null; + QueriesDescriptor = descriptor; + return Self; + } + + public DisMaxQueryDescriptor Queries(Action> configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorActions = null; + QueriesDescriptorAction = configure; + return Self; + } + + public DisMaxQueryDescriptor Queries(params Action>[] configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = configure; + return Self; + } + + public DisMaxQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public DisMaxQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. + /// + public DisMaxQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueriesDescriptor is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, QueriesDescriptor, options); + writer.WriteEndArray(); + } + else if (QueriesDescriptorAction is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (QueriesDescriptorActions is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + foreach (var action in QueriesDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DisMaxQueryDescriptor : SerializableDescriptor +{ + internal DisMaxQueryDescriptor(Action configure) => configure.Invoke(this); + + public DisMaxQueryDescriptor() : base() + { + } + + private ICollection QueriesValue { get; set; } + private QueryDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } + private Action[] QueriesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private double? TieBreakerValue { get; set; } + + /// + /// One or more query clauses.
Returned documents must match one or more of these queries.
If a document matches multiple queries, Elasticsearch uses the highest relevance score.
+ ///
+ public DisMaxQueryDescriptor Queries(ICollection queries) + { + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = null; + QueriesValue = queries; + return Self; + } + + public DisMaxQueryDescriptor Queries(QueryDescriptor descriptor) + { + QueriesValue = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = null; + QueriesDescriptor = descriptor; + return Self; + } + + public DisMaxQueryDescriptor Queries(Action configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorActions = null; + QueriesDescriptorAction = configure; + return Self; + } + + public DisMaxQueryDescriptor Queries(params Action[] configure) + { + QueriesValue = null; + QueriesDescriptor = null; + QueriesDescriptorAction = null; + QueriesDescriptorActions = configure; + return Self; + } + + public DisMaxQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public DisMaxQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. + /// + public DisMaxQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueriesDescriptor is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, QueriesDescriptor, options); + writer.WriteEndArray(); + } + else if (QueriesDescriptorAction is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (QueriesDescriptorActions is not null) + { + writer.WritePropertyName("queries"); + writer.WriteStartArray(); + foreach (var action in QueriesDescriptorActions) + { + JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("queries"); + JsonSerializer.Serialize(writer, QueriesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs new file mode 100644 index 00000000000..d8838554be7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs @@ -0,0 +1,181 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ExistsQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field you wish to search. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(ExistsQuery existsQuery) => QueryDsl.Query.Exists(existsQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("exists", this); +} + +public sealed partial class ExistsQueryDescriptor : SerializableDescriptor> +{ + internal ExistsQueryDescriptor(Action> configure) => configure.Invoke(this); + + public ExistsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public ExistsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ExistsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class ExistsQueryDescriptor : SerializableDescriptor +{ + internal ExistsQueryDescriptor(Action configure) => configure.Invoke(this); + + public ExistsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public ExistsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ExistsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs new file mode 100644 index 00000000000..64aad325775 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs @@ -0,0 +1,195 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +/// +/// A reference to a field with formatting instructions on how to return the value +/// +public sealed partial class FieldAndFormat +{ + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Format in which the values are returned. + /// + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("include_unmapped")] + public bool? IncludeUnmapped { get; set; } +} + +/// +/// A reference to a field with formatting instructions on how to return the value +/// +public sealed partial class FieldAndFormatDescriptor : SerializableDescriptor> +{ + internal FieldAndFormatDescriptor(Action> configure) => configure.Invoke(this); + + public FieldAndFormatDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private bool? IncludeUnmappedValue { get; set; } + + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + public FieldAndFormatDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + public FieldAndFormatDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Format in which the values are returned. + /// + public FieldAndFormatDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public FieldAndFormatDescriptor IncludeUnmapped(bool? includeUnmapped = true) + { + IncludeUnmappedValue = includeUnmapped; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IncludeUnmappedValue.HasValue) + { + writer.WritePropertyName("include_unmapped"); + writer.WriteBooleanValue(IncludeUnmappedValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// A reference to a field with formatting instructions on how to return the value +/// +public sealed partial class FieldAndFormatDescriptor : SerializableDescriptor +{ + internal FieldAndFormatDescriptor(Action configure) => configure.Invoke(this); + + public FieldAndFormatDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private bool? IncludeUnmappedValue { get; set; } + + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + public FieldAndFormatDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + public FieldAndFormatDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Wildcard pattern. The request returns values for field names matching this pattern. + /// + public FieldAndFormatDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Format in which the values are returned. + /// + public FieldAndFormatDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public FieldAndFormatDescriptor IncludeUnmapped(bool? includeUnmapped = true) + { + IncludeUnmappedValue = includeUnmapped; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (IncludeUnmappedValue.HasValue) + { + writer.WritePropertyName("include_unmapped"); + writer.WriteBooleanValue(IncludeUnmappedValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs new file mode 100644 index 00000000000..0eaf611eee6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs @@ -0,0 +1,236 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class FieldValueFactorScoreFunction +{ + /// + /// Optional factor to multiply the field value with. + /// + [JsonInclude, JsonPropertyName("factor")] + public double? Factor { get; set; } + + /// + /// Field to be extracted from the document. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Value used if the document doesn’t have that field.
The modifier and factor are still applied to it as though it were read from the document.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public double? Missing { get; set; } + + /// + /// Modifier to apply to the field value. + /// + [JsonInclude, JsonPropertyName("modifier")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorModifier? Modifier { get; set; } + + public static implicit operator FunctionScore(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => QueryDsl.FunctionScore.FieldValueFactor(fieldValueFactorScoreFunction); +} + +public sealed partial class FieldValueFactorScoreFunctionDescriptor : SerializableDescriptor> +{ + internal FieldValueFactorScoreFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public FieldValueFactorScoreFunctionDescriptor() : base() + { + } + + private double? FactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private double? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorModifier? ModifierValue { get; set; } + + /// + /// Optional factor to multiply the field value with. + /// + public FieldValueFactorScoreFunctionDescriptor Factor(double? factor) + { + FactorValue = factor; + return Self; + } + + /// + /// Field to be extracted from the document. + /// + public FieldValueFactorScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field to be extracted from the document. + /// + public FieldValueFactorScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Value used if the document doesn’t have that field.
The modifier and factor are still applied to it as though it were read from the document.
+ ///
+ public FieldValueFactorScoreFunctionDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Modifier to apply to the field value. + /// + public FieldValueFactorScoreFunctionDescriptor Modifier(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorModifier? modifier) + { + ModifierValue = modifier; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FactorValue.HasValue) + { + writer.WritePropertyName("factor"); + writer.WriteNumberValue(FactorValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (ModifierValue is not null) + { + writer.WritePropertyName("modifier"); + JsonSerializer.Serialize(writer, ModifierValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FieldValueFactorScoreFunctionDescriptor : SerializableDescriptor +{ + internal FieldValueFactorScoreFunctionDescriptor(Action configure) => configure.Invoke(this); + + public FieldValueFactorScoreFunctionDescriptor() : base() + { + } + + private double? FactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private double? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorModifier? ModifierValue { get; set; } + + /// + /// Optional factor to multiply the field value with. + /// + public FieldValueFactorScoreFunctionDescriptor Factor(double? factor) + { + FactorValue = factor; + return Self; + } + + /// + /// Field to be extracted from the document. + /// + public FieldValueFactorScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field to be extracted from the document. + /// + public FieldValueFactorScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field to be extracted from the document. + /// + public FieldValueFactorScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Value used if the document doesn’t have that field.
The modifier and factor are still applied to it as though it were read from the document.
+ ///
+ public FieldValueFactorScoreFunctionDescriptor Missing(double? missing) + { + MissingValue = missing; + return Self; + } + + /// + /// Modifier to apply to the field value. + /// + public FieldValueFactorScoreFunctionDescriptor Modifier(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorModifier? modifier) + { + ModifierValue = modifier; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FactorValue.HasValue) + { + writer.WritePropertyName("factor"); + writer.WriteNumberValue(FactorValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MissingValue.HasValue) + { + writer.WritePropertyName("missing"); + writer.WriteNumberValue(MissingValue.Value); + } + + if (ModifierValue is not null) + { + writer.WritePropertyName("modifier"); + JsonSerializer.Serialize(writer, ModifierValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs new file mode 100644 index 00000000000..01c4c26fc0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -0,0 +1,394 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(FunctionScoreConverter))] +public sealed partial class FunctionScore +{ + internal FunctionScore(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static FunctionScore FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => new FunctionScore("field_value_factor", fieldValueFactorScoreFunction); + public static FunctionScore RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => new FunctionScore("random_score", randomScoreFunction); + public static FunctionScore ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreFunction scriptScoreFunction) => new FunctionScore("script_score", scriptScoreFunction); + + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + [JsonInclude, JsonPropertyName("weight")] + public double? Weight { get; set; } +} + +internal sealed partial class FunctionScoreConverter : JsonConverter +{ + public override FunctionScore Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + object? variantValue = default; + string? variantNameValue = default; + Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filterValue = default; + double? weightValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "filter") + { + filterValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "weight") + { + weightValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "field_value_factor") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "random_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "script_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'FunctionScore' from the response."); + } + + reader.Read(); + var result = new FunctionScore(variantNameValue, variantValue); + result.Filter = filterValue; + result.Weight = weightValue; + return result; + } + + public override void Write(Utf8JsonWriter writer, FunctionScore value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Filter is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, value.Filter, options); + } + + if (value.Weight.HasValue) + { + writer.WritePropertyName("weight"); + writer.WriteNumberValue(value.Weight.Value); + } + + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "field_value_factor": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction)value.Variant, options); + break; + case "random_score": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction)value.Variant, options); + break; + case "script_score": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreFunction)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FunctionScoreDescriptor : SerializableDescriptor> +{ + internal FunctionScoreDescriptor(Action> configure) => configure.Invoke(this); + + public FunctionScoreDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private FunctionScoreDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private FunctionScoreDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private double? WeightValue { get; set; } + + public FunctionScoreDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FunctionScoreDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FunctionScoreDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public FunctionScoreDescriptor Weight(double? weight) + { + WeightValue = weight; + return Self; + } + + public FunctionScoreDescriptor FieldValueFactor(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); + public FunctionScoreDescriptor ScriptScore(Action configure) => Set(configure, "script_score"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (WeightValue.HasValue) + { + writer.WritePropertyName("weight"); + writer.WriteNumberValue(WeightValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FunctionScoreDescriptor : SerializableDescriptor +{ + internal FunctionScoreDescriptor(Action configure) => configure.Invoke(this); + + public FunctionScoreDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private FunctionScoreDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private FunctionScoreDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private double? WeightValue { get; set; } + + public FunctionScoreDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FunctionScoreDescriptor Filter(QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FunctionScoreDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + public FunctionScoreDescriptor Weight(double? weight) + { + WeightValue = weight; + return Self; + } + + public FunctionScoreDescriptor FieldValueFactor(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); + public FunctionScoreDescriptor ScriptScore(Action configure) => Set(configure, "script_score"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (WeightValue.HasValue) + { + writer.WritePropertyName("weight"); + writer.WriteNumberValue(WeightValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs new file mode 100644 index 00000000000..f34b077887b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs @@ -0,0 +1,528 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class FunctionScoreQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Defines how he newly computed score is combined with the score of the query + /// + [JsonInclude, JsonPropertyName("boost_mode")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? BoostMode { get; set; } + + /// + /// One or more functions that compute a new score for each document returned by the query. + /// + [JsonInclude, JsonPropertyName("functions")] + public ICollection? Functions { get; set; } + + /// + /// Restricts the new score to not exceed the provided limit. + /// + [JsonInclude, JsonPropertyName("max_boost")] + public double? MaxBoost { get; set; } + + /// + /// Excludes documents that do not meet the provided score threshold. + /// + [JsonInclude, JsonPropertyName("min_score")] + public double? MinScore { get; set; } + + /// + /// A query that determines the documents for which a new score is computed. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// Specifies how the computed scores are combined + /// + [JsonInclude, JsonPropertyName("score_mode")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? ScoreMode { get; set; } + + public static implicit operator Query(FunctionScoreQuery functionScoreQuery) => QueryDsl.Query.FunctionScore(functionScoreQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("function_score", this); +} + +public sealed partial class FunctionScoreQueryDescriptor : SerializableDescriptor> +{ + internal FunctionScoreQueryDescriptor(Action> configure) => configure.Invoke(this); + + public FunctionScoreQueryDescriptor() : base() + { + } + + private ICollection? FunctionsValue { get; set; } + private FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action> FunctionsDescriptorAction { get; set; } + private Action>[] FunctionsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } + private double? MaxBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + + /// + /// One or more functions that compute a new score for each document returned by the query. + /// + public FunctionScoreQueryDescriptor Functions(ICollection? functions) + { + FunctionsDescriptor = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = null; + FunctionsValue = functions; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(FunctionScoreDescriptor descriptor) + { + FunctionsValue = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = null; + FunctionsDescriptor = descriptor; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(Action> configure) + { + FunctionsValue = null; + FunctionsDescriptor = null; + FunctionsDescriptorActions = null; + FunctionsDescriptorAction = configure; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(params Action>[] configure) + { + FunctionsValue = null; + FunctionsDescriptor = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = configure; + return Self; + } + + /// + /// A query that determines the documents for which a new score is computed. + /// + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public FunctionScoreQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public FunctionScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public FunctionScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Defines how he newly computed score is combined with the score of the query + /// + public FunctionScoreQueryDescriptor BoostMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? boostMode) + { + BoostModeValue = boostMode; + return Self; + } + + /// + /// Restricts the new score to not exceed the provided limit. + /// + public FunctionScoreQueryDescriptor MaxBoost(double? maxBoost) + { + MaxBoostValue = maxBoost; + return Self; + } + + /// + /// Excludes documents that do not meet the provided score threshold. + /// + public FunctionScoreQueryDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Specifies how the computed scores are combined + /// + public FunctionScoreQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FunctionsDescriptor is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FunctionsDescriptor, options); + writer.WriteEndArray(); + } + else if (FunctionsDescriptorAction is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FunctionsDescriptorActions is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + foreach (var action in FunctionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FunctionsValue is not null) + { + writer.WritePropertyName("functions"); + JsonSerializer.Serialize(writer, FunctionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (BoostModeValue is not null) + { + writer.WritePropertyName("boost_mode"); + JsonSerializer.Serialize(writer, BoostModeValue, options); + } + + if (MaxBoostValue.HasValue) + { + writer.WritePropertyName("max_boost"); + writer.WriteNumberValue(MaxBoostValue.Value); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FunctionScoreQueryDescriptor : SerializableDescriptor +{ + internal FunctionScoreQueryDescriptor(Action configure) => configure.Invoke(this); + + public FunctionScoreQueryDescriptor() : base() + { + } + + private ICollection? FunctionsValue { get; set; } + private FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action FunctionsDescriptorAction { get; set; } + private Action[] FunctionsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } + private double? MaxBoostValue { get; set; } + private double? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + + /// + /// One or more functions that compute a new score for each document returned by the query. + /// + public FunctionScoreQueryDescriptor Functions(ICollection? functions) + { + FunctionsDescriptor = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = null; + FunctionsValue = functions; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(FunctionScoreDescriptor descriptor) + { + FunctionsValue = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = null; + FunctionsDescriptor = descriptor; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(Action configure) + { + FunctionsValue = null; + FunctionsDescriptor = null; + FunctionsDescriptorActions = null; + FunctionsDescriptorAction = configure; + return Self; + } + + public FunctionScoreQueryDescriptor Functions(params Action[] configure) + { + FunctionsValue = null; + FunctionsDescriptor = null; + FunctionsDescriptorAction = null; + FunctionsDescriptorActions = configure; + return Self; + } + + /// + /// A query that determines the documents for which a new score is computed. + /// + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public FunctionScoreQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public FunctionScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public FunctionScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Defines how he newly computed score is combined with the score of the query + /// + public FunctionScoreQueryDescriptor BoostMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? boostMode) + { + BoostModeValue = boostMode; + return Self; + } + + /// + /// Restricts the new score to not exceed the provided limit. + /// + public FunctionScoreQueryDescriptor MaxBoost(double? maxBoost) + { + MaxBoostValue = maxBoost; + return Self; + } + + /// + /// Excludes documents that do not meet the provided score threshold. + /// + public FunctionScoreQueryDescriptor MinScore(double? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Specifies how the computed scores are combined + /// + public FunctionScoreQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FunctionsDescriptor is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FunctionsDescriptor, options); + writer.WriteEndArray(); + } + else if (FunctionsDescriptorAction is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FunctionsDescriptorActions is not null) + { + writer.WritePropertyName("functions"); + writer.WriteStartArray(); + foreach (var action in FunctionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FunctionsValue is not null) + { + writer.WritePropertyName("functions"); + JsonSerializer.Serialize(writer, FunctionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (BoostModeValue is not null) + { + writer.WritePropertyName("boost_mode"); + JsonSerializer.Serialize(writer, BoostModeValue, options); + } + + if (MaxBoostValue.HasValue) + { + writer.WritePropertyName("max_boost"); + writer.WriteNumberValue(MaxBoostValue.Value); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs new file mode 100644 index 00000000000..21a945a9b86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs @@ -0,0 +1,539 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class FuzzyQueryConverter : JsonConverter +{ + public override FuzzyQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new FuzzyQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzziness") + { + variant.Fuzziness = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_expansions") + { + variant.MaxExpansions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prefix_length") + { + variant.PrefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rewrite") + { + variant.Rewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "transpositions") + { + variant.Transpositions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, FuzzyQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize FuzzyQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } + + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } + + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } + + if (value.Rewrite is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, value.Rewrite, options); + } + + if (value.Transpositions.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(value.Transpositions.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(FuzzyQueryConverter))] +public sealed partial class FuzzyQuery : SearchQuery +{ + public FuzzyQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Maximum edit distance allowed for matching. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Maximum number of variations created. + /// + public int? MaxExpansions { get; set; } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public int? PrefixLength { get; set; } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public string? Rewrite { get; set; } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). + /// + public bool? Transpositions { get; set; } + + /// + /// Term you wish to find in the provided field. + /// + public object Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(FuzzyQuery fuzzyQuery) => QueryDsl.Query.Fuzzy(fuzzyQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("fuzzy", this); +} + +public sealed partial class FuzzyQueryDescriptor : SerializableDescriptor> +{ + internal FuzzyQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal FuzzyQueryDescriptor() : base() + { + } + + public FuzzyQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public FuzzyQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string? RewriteValue { get; set; } + private bool? TranspositionsValue { get; set; } + private object ValueValue { get; set; } + + public FuzzyQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public FuzzyQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public FuzzyQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public FuzzyQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public FuzzyQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Maximum number of variations created. + /// + public FuzzyQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public FuzzyQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public FuzzyQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). + /// + public FuzzyQueryDescriptor Transpositions(bool? transpositions = true) + { + TranspositionsValue = transpositions; + return Self; + } + + /// + /// Term you wish to find in the provided field. + /// + public FuzzyQueryDescriptor Value(object value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (TranspositionsValue.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(TranspositionsValue.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class FuzzyQueryDescriptor : SerializableDescriptor +{ + internal FuzzyQueryDescriptor(Action configure) => configure.Invoke(this); + + internal FuzzyQueryDescriptor() : base() + { + } + + public FuzzyQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string? RewriteValue { get; set; } + private bool? TranspositionsValue { get; set; } + private object ValueValue { get; set; } + + public FuzzyQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public FuzzyQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public FuzzyQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public FuzzyQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public FuzzyQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public FuzzyQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Maximum number of variations created. + /// + public FuzzyQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public FuzzyQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public FuzzyQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). + /// + public FuzzyQueryDescriptor Transpositions(bool? transpositions = true) + { + TranspositionsValue = transpositions; + return Self; + } + + /// + /// Term you wish to find in the provided field. + /// + public FuzzyQueryDescriptor Value(object value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (TranspositionsValue.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(TranspositionsValue.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs new file mode 100644 index 00000000000..2105a92c0b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs @@ -0,0 +1,347 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class GeoBoundingBoxQueryConverter : JsonConverter +{ + public override GeoBoundingBoxQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoBoundingBoxQuery(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ignore_unmapped") + { + variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "validation_method") + { + variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.BoundingBox = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoBoundingBoxQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.BoundingBox is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.BoundingBox, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.IgnoreUnmapped.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(value.IgnoreUnmapped.Value); + } + + if (value.ValidationMethod is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, value.ValidationMethod, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoBoundingBoxQueryConverter))] +public sealed partial class GeoBoundingBoxQuery : SearchQuery +{ + public string? QueryName { get; set; } + public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBox { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
+ ///
+ public bool? IgnoreUnmapped { get; set; } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } + + public static implicit operator Query(GeoBoundingBoxQuery geoBoundingBoxQuery) => QueryDsl.Query.GeoBoundingBox(geoBoundingBoxQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("geo_bounding_box", this); +} + +public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor> +{ + internal GeoBoundingBoxQueryDescriptor(Action> configure) => configure.Invoke(this); + + public GeoBoundingBoxQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } + + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
+ ///
+ public GeoBoundingBoxQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public GeoBoundingBoxQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) + { + BoundingBoxValue = boundingBox; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && BoundingBoxValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, BoundingBoxValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor +{ + internal GeoBoundingBoxQueryDescriptor(Action configure) => configure.Invoke(this); + + public GeoBoundingBoxQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } + + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
+ ///
+ public GeoBoundingBoxQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public GeoBoundingBoxQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) + { + BoundingBoxValue = boundingBox; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoBoundingBoxQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && BoundingBoxValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, BoundingBoxValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs new file mode 100644 index 00000000000..d89e4d3b977 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs @@ -0,0 +1,384 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class GeoDistanceQueryConverter : JsonConverter +{ + public override GeoDistanceQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoDistanceQuery(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "distance") + { + variant.Distance = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "distance_type") + { + variant.DistanceType = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "validation_method") + { + variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Location = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Location is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Location, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WritePropertyName("distance"); + JsonSerializer.Serialize(writer, value.Distance, options); + if (value.DistanceType is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, value.DistanceType, options); + } + + if (value.ValidationMethod is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, value.ValidationMethod, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoDistanceQueryConverter))] +public sealed partial class GeoDistanceQuery : SearchQuery +{ + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// The radius of the circle centred on the specified location.
Points which fall into this circle are considered to be matches.
+ ///
+ public string Distance { get; set; } + + /// + /// How to compute the distance.
Set to `plane` for a faster calculation that's inaccurate on long distances and close to the poles.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceType { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation Location { get; set; } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } + + public static implicit operator Query(GeoDistanceQuery geoDistanceQuery) => QueryDsl.Query.GeoDistance(geoDistanceQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("geo_distance", this); +} + +public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor> +{ + internal GeoDistanceQueryDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDistanceQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private string DistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation LocationValue { get; set; } + + public GeoDistanceQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoDistanceQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The radius of the circle centred on the specified location.
Points which fall into this circle are considered to be matches.
+ ///
+ public GeoDistanceQueryDescriptor Distance(string distance) + { + DistanceValue = distance; + return Self; + } + + /// + /// How to compute the distance.
Set to `plane` for a faster calculation that's inaccurate on long distances and close to the poles.
+ ///
+ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) + { + LocationValue = location; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && LocationValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("distance"); + JsonSerializer.Serialize(writer, DistanceValue, options); + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor +{ + internal GeoDistanceQueryDescriptor(Action configure) => configure.Invoke(this); + + public GeoDistanceQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private string DistanceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation LocationValue { get; set; } + + public GeoDistanceQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoDistanceQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The radius of the circle centred on the specified location.
Points which fall into this circle are considered to be matches.
+ ///
+ public GeoDistanceQueryDescriptor Distance(string distance) + { + DistanceValue = distance; + return Self; + } + + /// + /// How to compute the distance.
Set to `plane` for a faster calculation that's inaccurate on long distances and close to the poles.
+ ///
+ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? distanceType) + { + DistanceTypeValue = distanceType; + return Self; + } + + /// + /// Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.
+ ///
+ public GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) + { + LocationValue = location; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && LocationValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, LocationValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("distance"); + JsonSerializer.Serialize(writer, DistanceValue, options); + if (DistanceTypeValue is not null) + { + writer.WritePropertyName("distance_type"); + JsonSerializer.Serialize(writer, DistanceTypeValue, options); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs new file mode 100644 index 00000000000..4ddfcc70046 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class GeoPolygonPoints +{ + [JsonInclude, JsonPropertyName("points")] + public ICollection Points { get; set; } +} + +public sealed partial class GeoPolygonPointsDescriptor : SerializableDescriptor +{ + internal GeoPolygonPointsDescriptor(Action configure) => configure.Invoke(this); + + public GeoPolygonPointsDescriptor() : base() + { + } + + private ICollection PointsValue { get; set; } + + public GeoPolygonPointsDescriptor Points(ICollection points) + { + PointsValue = points; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("points"); + JsonSerializer.Serialize(writer, PointsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs new file mode 100644 index 00000000000..775b07edecb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs @@ -0,0 +1,387 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class GeoPolygonQueryConverter : JsonConverter +{ + public override GeoPolygonQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoPolygonQuery(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ignore_unmapped") + { + variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "validation_method") + { + variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Polygon = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Polygon is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Polygon, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.IgnoreUnmapped.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(value.IgnoreUnmapped.Value); + } + + if (value.ValidationMethod is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, value.ValidationMethod, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoPolygonQueryConverter))] +public sealed partial class GeoPolygonQuery : SearchQuery +{ + public string? QueryName { get; set; } + public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public bool? IgnoreUnmapped { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints Polygon { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } + + public static implicit operator Query(GeoPolygonQuery geoPolygonQuery) => QueryDsl.Query.GeoPolygon(geoPolygonQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("geo_polygon", this); +} + +public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> +{ + internal GeoPolygonQueryDescriptor(Action> configure) => configure.Invoke(this); + + public GeoPolygonQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } + + public GeoPolygonQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoPolygonQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) + { + PolygonValue = polygon; + return Self; + } + + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + { + PolygonValue = null; + PolygonDescriptorAction = null; + PolygonDescriptor = descriptor; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(Action configure) + { + PolygonValue = null; + PolygonDescriptor = null; + PolygonDescriptorAction = configure; + return Self; + } + + public GeoPolygonQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && (PolygonValue is not null || PolygonDescriptor is not null || PolygonDescriptorAction is not null)) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + if (PolygonValue is not null) + { + JsonSerializer.Serialize(writer, PolygonValue, options); + } + else if (PolygonDescriptor is not null) + { + JsonSerializer.Serialize(writer, PolygonDescriptor, options); + } + else if (PolygonDescriptorAction is not null) + { + var descriptor = new GeoPolygonPointsDescriptor(PolygonDescriptorAction); + JsonSerializer.Serialize(writer, descriptor, options); + } + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor +{ + internal GeoPolygonQueryDescriptor(Action configure) => configure.Invoke(this); + + public GeoPolygonQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } + + public GeoPolygonQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public GeoPolygonQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) + { + PolygonValue = polygon; + return Self; + } + + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + { + PolygonValue = null; + PolygonDescriptorAction = null; + PolygonDescriptor = descriptor; + return Self; + } + + public GeoPolygonQueryDescriptor Polygon(Action configure) + { + PolygonValue = null; + PolygonDescriptor = null; + PolygonDescriptorAction = configure; + return Self; + } + + public GeoPolygonQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoPolygonQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && (PolygonValue is not null || PolygonDescriptor is not null || PolygonDescriptorAction is not null)) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + if (PolygonValue is not null) + { + JsonSerializer.Serialize(writer, PolygonValue, options); + } + else if (PolygonDescriptor is not null) + { + JsonSerializer.Serialize(writer, PolygonDescriptor, options); + } + else if (PolygonDescriptorAction is not null) + { + var descriptor = new GeoPolygonPointsDescriptor(PolygonDescriptorAction); + JsonSerializer.Serialize(writer, descriptor, options); + } + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (ValidationMethodValue is not null) + { + writer.WritePropertyName("validation_method"); + JsonSerializer.Serialize(writer, ValidationMethodValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs new file mode 100644 index 00000000000..b3de11ad53a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs @@ -0,0 +1,502 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class HasChildQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. + /// + [JsonInclude, JsonPropertyName("ignore_unmapped")] + public bool? IgnoreUnmapped { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + [JsonInclude, JsonPropertyName("inner_hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHits { get; set; } + + /// + /// Maximum number of child documents that match the query allowed for a returned parent document.
If the parent document exceeds this limit, it is excluded from the search results.
+ ///
+ [JsonInclude, JsonPropertyName("max_children")] + public int? MaxChildren { get; set; } + + /// + /// Minimum number of child documents that match the query required to match the query for a returned parent document.
If the parent document does not meet this limit, it is excluded from the search results.
+ ///
+ [JsonInclude, JsonPropertyName("min_children")] + public int? MinChildren { get; set; } + + /// + /// Query you wish to run on child documents of the `type` field.
If a child document matches the search, the query returns the parent document.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// Indicates how scores for matching child documents affect the root parent document’s relevance score. + /// + [JsonInclude, JsonPropertyName("score_mode")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreMode { get; set; } + + /// + /// Name of the child relationship mapped for the `join` field. + /// + [JsonInclude, JsonPropertyName("type")] + public string Type { get; set; } + + public static implicit operator Query(HasChildQuery hasChildQuery) => QueryDsl.Query.HasChild(hasChildQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("has_child", this); +} + +public sealed partial class HasChildQueryDescriptor : SerializableDescriptor> +{ + internal HasChildQueryDescriptor(Action> configure) => configure.Invoke(this); + + public HasChildQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private int? MaxChildrenValue { get; set; } + private int? MinChildrenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + private string TypeValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public HasChildQueryDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on child documents of the `type` field.
If a child document matches the search, the query returns the parent document.
+ ///
+ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HasChildQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public HasChildQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public HasChildQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. + /// + public HasChildQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Maximum number of child documents that match the query allowed for a returned parent document.
If the parent document exceeds this limit, it is excluded from the search results.
+ ///
+ public HasChildQueryDescriptor MaxChildren(int? maxChildren) + { + MaxChildrenValue = maxChildren; + return Self; + } + + /// + /// Minimum number of child documents that match the query required to match the query for a returned parent document.
If the parent document does not meet this limit, it is excluded from the search results.
+ ///
+ public HasChildQueryDescriptor MinChildren(int? minChildren) + { + MinChildrenValue = minChildren; + return Self; + } + + /// + /// Indicates how scores for matching child documents affect the root parent document’s relevance score. + /// + public HasChildQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + /// + /// Name of the child relationship mapped for the `join` field. + /// + public HasChildQueryDescriptor Type(string type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (MaxChildrenValue.HasValue) + { + writer.WritePropertyName("max_children"); + writer.WriteNumberValue(MaxChildrenValue.Value); + } + + if (MinChildrenValue.HasValue) + { + writer.WritePropertyName("min_children"); + writer.WriteNumberValue(MinChildrenValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class HasChildQueryDescriptor : SerializableDescriptor +{ + internal HasChildQueryDescriptor(Action configure) => configure.Invoke(this); + + public HasChildQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private int? MaxChildrenValue { get; set; } + private int? MinChildrenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + private string TypeValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public HasChildQueryDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on child documents of the `type` field.
If a child document matches the search, the query returns the parent document.
+ ///
+ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HasChildQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public HasChildQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public HasChildQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. + /// + public HasChildQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Maximum number of child documents that match the query allowed for a returned parent document.
If the parent document exceeds this limit, it is excluded from the search results.
+ ///
+ public HasChildQueryDescriptor MaxChildren(int? maxChildren) + { + MaxChildrenValue = maxChildren; + return Self; + } + + /// + /// Minimum number of child documents that match the query required to match the query for a returned parent document.
If the parent document does not meet this limit, it is excluded from the search results.
+ ///
+ public HasChildQueryDescriptor MinChildren(int? minChildren) + { + MinChildrenValue = minChildren; + return Self; + } + + /// + /// Indicates how scores for matching child documents affect the root parent document’s relevance score. + /// + public HasChildQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + /// + /// Name of the child relationship mapped for the `join` field. + /// + public HasChildQueryDescriptor Type(string type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (MaxChildrenValue.HasValue) + { + writer.WritePropertyName("max_children"); + writer.WriteNumberValue(MaxChildrenValue.Value); + } + + if (MinChildrenValue.HasValue) + { + writer.WritePropertyName("min_children"); + writer.WriteNumberValue(MinChildrenValue.Value); + } + + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs new file mode 100644 index 00000000000..0fd9ec1821c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs @@ -0,0 +1,426 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class HasParentQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.
You can use this parameter to query multiple indices that may not contain the `parent_type`.
+ ///
+ [JsonInclude, JsonPropertyName("ignore_unmapped")] + public bool? IgnoreUnmapped { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + [JsonInclude, JsonPropertyName("inner_hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHits { get; set; } + + /// + /// Name of the parent relationship mapped for the `join` field. + /// + [JsonInclude, JsonPropertyName("parent_type")] + public string ParentType { get; set; } + + /// + /// Query you wish to run on parent documents of the `parent_type` field.
If a parent document matches the search, the query returns its child documents.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// Indicates whether the relevance score of a matching parent document is aggregated into its child documents. + /// + [JsonInclude, JsonPropertyName("score")] + public bool? Score { get; set; } + + public static implicit operator Query(HasParentQuery hasParentQuery) => QueryDsl.Query.HasParent(hasParentQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("has_parent", this); +} + +public sealed partial class HasParentQueryDescriptor : SerializableDescriptor> +{ + internal HasParentQueryDescriptor(Action> configure) => configure.Invoke(this); + + public HasParentQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private string ParentTypeValue { get; set; } + private bool? ScoreValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public HasParentQueryDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on parent documents of the `parent_type` field.
If a parent document matches the search, the query returns its child documents.
+ ///
+ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HasParentQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public HasParentQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public HasParentQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.
You can use this parameter to query multiple indices that may not contain the `parent_type`.
+ ///
+ public HasParentQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Name of the parent relationship mapped for the `join` field. + /// + public HasParentQueryDescriptor ParentType(string parentType) + { + ParentTypeValue = parentType; + return Self; + } + + /// + /// Indicates whether the relevance score of a matching parent document is aggregated into its child documents. + /// + public HasParentQueryDescriptor Score(bool? score = true) + { + ScoreValue = score; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + writer.WritePropertyName("parent_type"); + JsonSerializer.Serialize(writer, ParentTypeValue, options); + if (ScoreValue.HasValue) + { + writer.WritePropertyName("score"); + writer.WriteBooleanValue(ScoreValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HasParentQueryDescriptor : SerializableDescriptor +{ + internal HasParentQueryDescriptor(Action configure) => configure.Invoke(this); + + public HasParentQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private string ParentTypeValue { get; set; } + private bool? ScoreValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public HasParentQueryDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on parent documents of the `parent_type` field.
If a parent document matches the search, the query returns its child documents.
+ ///
+ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HasParentQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public HasParentQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public HasParentQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.
You can use this parameter to query multiple indices that may not contain the `parent_type`.
+ ///
+ public HasParentQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Name of the parent relationship mapped for the `join` field. + /// + public HasParentQueryDescriptor ParentType(string parentType) + { + ParentTypeValue = parentType; + return Self; + } + + /// + /// Indicates whether the relevance score of a matching parent document is aggregated into its child documents. + /// + public HasParentQueryDescriptor Score(bool? score = true) + { + ScoreValue = score; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + writer.WritePropertyName("parent_type"); + JsonSerializer.Serialize(writer, ParentTypeValue, options); + if (ScoreValue.HasValue) + { + writer.WritePropertyName("score"); + writer.WriteBooleanValue(ScoreValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs new file mode 100644 index 00000000000..1d98a7be21c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs @@ -0,0 +1,104 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IdsQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// An array of document IDs. + /// + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Serverless.Ids? Values { get; set; } + + public static implicit operator Query(IdsQuery idsQuery) => QueryDsl.Query.Ids(idsQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("ids", this); +} + +public sealed partial class IdsQueryDescriptor : SerializableDescriptor +{ + internal IdsQueryDescriptor(Action configure) => configure.Invoke(this); + + public IdsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ids? ValuesValue { get; set; } + + public IdsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public IdsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// An array of document IDs. + /// + public IdsQueryDescriptor Values(Elastic.Clients.Elasticsearch.Serverless.Ids? values) + { + ValuesValue = values; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (ValuesValue is not null) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, ValuesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs new file mode 100644 index 00000000000..e1fb71f65db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs @@ -0,0 +1,287 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(IntervalsConverter))] +public sealed partial class Intervals +{ + internal Intervals(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static Intervals AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => new Intervals("all_of", intervalsAllOf); + public static Intervals AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => new Intervals("any_of", intervalsAnyOf); + public static Intervals Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => new Intervals("fuzzy", intervalsFuzzy); + public static Intervals Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => new Intervals("match", intervalsMatch); + public static Intervals Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => new Intervals("prefix", intervalsPrefix); + public static Intervals Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsWildcard intervalsWildcard) => new Intervals("wildcard", intervalsWildcard); +} + +internal sealed partial class IntervalsConverter : JsonConverter +{ + public override Intervals Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "all_of") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + if (propertyName == "any_of") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + if (propertyName == "fuzzy") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + if (propertyName == "match") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + if (propertyName == "prefix") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + if (propertyName == "wildcard") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Intervals(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Intervals value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "all_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf)value.Variant, options); + break; + case "any_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf)value.Variant, options); + break; + case "fuzzy": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy)value.Variant, options); + break; + case "match": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch)value.Variant, options); + break; + case "prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix)value.Variant, options); + break; + case "wildcard": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsWildcard)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsDescriptor : SerializableDescriptor> +{ + internal IntervalsDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IntervalsDescriptor AllOf(IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(IntervalsWildcard intervalsWildcard) => Set(intervalsWildcard, "wildcard"); + public IntervalsDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsDescriptor : SerializableDescriptor +{ + internal IntervalsDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IntervalsDescriptor AllOf(IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(IntervalsWildcard intervalsWildcard) => Set(intervalsWildcard, "wildcard"); + public IntervalsDescriptor Wildcard(Action configure) => Set(configure, "wildcard"); + public IntervalsDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs new file mode 100644 index 00000000000..d4f828f3ac7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs @@ -0,0 +1,391 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsAllOf +{ + /// + /// Rule used to filter returned intervals. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? Filter { get; set; } + + /// + /// An array of rules to combine. All rules must produce a match in a document for the overall source to match. + /// + [JsonInclude, JsonPropertyName("intervals")] + public ICollection Intervals { get; set; } + + /// + /// Maximum number of positions between the matching terms.
Intervals produced by the rules further apart than this are not considered matches.
+ ///
+ [JsonInclude, JsonPropertyName("max_gaps")] + public int? MaxGaps { get; set; } + + /// + /// If `true`, intervals produced by the rules should appear in the order in which they are specified. + /// + [JsonInclude, JsonPropertyName("ordered")] + public bool? Ordered { get; set; } +} + +public sealed partial class IntervalsAllOfDescriptor : SerializableDescriptor> +{ + internal IntervalsAllOfDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsAllOfDescriptor() : base() + { + } + + private ICollection IntervalsValue { get; set; } + private IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MaxGapsValue { get; set; } + private bool? OrderedValue { get; set; } + + /// + /// An array of rules to combine. All rules must produce a match in a document for the overall source to match. + /// + public IntervalsAllOfDescriptor Intervals(ICollection intervals) + { + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsValue = intervals; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(IntervalsDescriptor descriptor) + { + IntervalsValue = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsDescriptor = descriptor; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(Action> configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorActions = null; + IntervalsDescriptorAction = configure; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(params Action>[] configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = configure; + return Self; + } + + /// + /// Rule used to filter returned intervals. + /// + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsAllOfDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of positions between the matching terms.
Intervals produced by the rules further apart than this are not considered matches.
+ ///
+ public IntervalsAllOfDescriptor MaxGaps(int? maxGaps) + { + MaxGapsValue = maxGaps; + return Self; + } + + /// + /// If `true`, intervals produced by the rules should appear in the order in which they are specified. + /// + public IntervalsAllOfDescriptor Ordered(bool? ordered = true) + { + OrderedValue = ordered; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IntervalsDescriptor is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IntervalsDescriptor, options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorAction is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorActions is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + foreach (var action in IntervalsDescriptorActions) + { + JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("intervals"); + JsonSerializer.Serialize(writer, IntervalsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MaxGapsValue.HasValue) + { + writer.WritePropertyName("max_gaps"); + writer.WriteNumberValue(MaxGapsValue.Value); + } + + if (OrderedValue.HasValue) + { + writer.WritePropertyName("ordered"); + writer.WriteBooleanValue(OrderedValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsAllOfDescriptor : SerializableDescriptor +{ + internal IntervalsAllOfDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsAllOfDescriptor() : base() + { + } + + private ICollection IntervalsValue { get; set; } + private IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MaxGapsValue { get; set; } + private bool? OrderedValue { get; set; } + + /// + /// An array of rules to combine. All rules must produce a match in a document for the overall source to match. + /// + public IntervalsAllOfDescriptor Intervals(ICollection intervals) + { + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsValue = intervals; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(IntervalsDescriptor descriptor) + { + IntervalsValue = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsDescriptor = descriptor; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(Action configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorActions = null; + IntervalsDescriptorAction = configure; + return Self; + } + + public IntervalsAllOfDescriptor Intervals(params Action[] configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = configure; + return Self; + } + + /// + /// Rule used to filter returned intervals. + /// + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsAllOfDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of positions between the matching terms.
Intervals produced by the rules further apart than this are not considered matches.
+ ///
+ public IntervalsAllOfDescriptor MaxGaps(int? maxGaps) + { + MaxGapsValue = maxGaps; + return Self; + } + + /// + /// If `true`, intervals produced by the rules should appear in the order in which they are specified. + /// + public IntervalsAllOfDescriptor Ordered(bool? ordered = true) + { + OrderedValue = ordered; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IntervalsDescriptor is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IntervalsDescriptor, options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorAction is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorActions is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + foreach (var action in IntervalsDescriptorActions) + { + JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("intervals"); + JsonSerializer.Serialize(writer, IntervalsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MaxGapsValue.HasValue) + { + writer.WritePropertyName("max_gaps"); + writer.WriteNumberValue(MaxGapsValue.Value); + } + + if (OrderedValue.HasValue) + { + writer.WritePropertyName("ordered"); + writer.WriteBooleanValue(OrderedValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs new file mode 100644 index 00000000000..3919b38b17f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs @@ -0,0 +1,315 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsAnyOf +{ + /// + /// Rule used to filter returned intervals. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? Filter { get; set; } + + /// + /// An array of rules to match. + /// + [JsonInclude, JsonPropertyName("intervals")] + public ICollection Intervals { get; set; } +} + +public sealed partial class IntervalsAnyOfDescriptor : SerializableDescriptor> +{ + internal IntervalsAnyOfDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsAnyOfDescriptor() : base() + { + } + + private ICollection IntervalsValue { get; set; } + private IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + + /// + /// An array of rules to match. + /// + public IntervalsAnyOfDescriptor Intervals(ICollection intervals) + { + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsValue = intervals; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(IntervalsDescriptor descriptor) + { + IntervalsValue = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsDescriptor = descriptor; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(Action> configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorActions = null; + IntervalsDescriptorAction = configure; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(params Action>[] configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = configure; + return Self; + } + + /// + /// Rule used to filter returned intervals. + /// + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsAnyOfDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IntervalsDescriptor is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IntervalsDescriptor, options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorAction is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorActions is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + foreach (var action in IntervalsDescriptorActions) + { + JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("intervals"); + JsonSerializer.Serialize(writer, IntervalsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsAnyOfDescriptor : SerializableDescriptor +{ + internal IntervalsAnyOfDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsAnyOfDescriptor() : base() + { + } + + private ICollection IntervalsValue { get; set; } + private IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + + /// + /// An array of rules to match. + /// + public IntervalsAnyOfDescriptor Intervals(ICollection intervals) + { + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsValue = intervals; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(IntervalsDescriptor descriptor) + { + IntervalsValue = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = null; + IntervalsDescriptor = descriptor; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(Action configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorActions = null; + IntervalsDescriptorAction = configure; + return Self; + } + + public IntervalsAnyOfDescriptor Intervals(params Action[] configure) + { + IntervalsValue = null; + IntervalsDescriptor = null; + IntervalsDescriptorAction = null; + IntervalsDescriptorActions = configure; + return Self; + } + + /// + /// Rule used to filter returned intervals. + /// + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsAnyOfDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IntervalsDescriptor is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, IntervalsDescriptor, options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorAction is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (IntervalsDescriptorActions is not null) + { + writer.WritePropertyName("intervals"); + writer.WriteStartArray(); + foreach (var action in IntervalsDescriptorActions) + { + JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("intervals"); + JsonSerializer.Serialize(writer, IntervalsValue, options); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs new file mode 100644 index 00000000000..e2463371437 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs @@ -0,0 +1,185 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(IntervalsFilterConverter))] +public sealed partial class IntervalsFilter +{ + internal IntervalsFilter(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } +} + +internal sealed partial class IntervalsFilterConverter : JsonConverter +{ + public override IntervalsFilter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, IntervalsFilter value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsFilterDescriptor : SerializableDescriptor> +{ + internal IntervalsFilterDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsFilterDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsFilterDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsFilterDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsFilterDescriptor : SerializableDescriptor +{ + internal IntervalsFilterDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsFilterDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsFilterDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsFilterDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs new file mode 100644 index 00000000000..27f900fcf5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs @@ -0,0 +1,310 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsFuzzy +{ + /// + /// Analyzer used to normalize the term. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// Maximum edit distance allowed for matching. + /// + [JsonInclude, JsonPropertyName("fuzziness")] + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + [JsonInclude, JsonPropertyName("prefix_length")] + public int? PrefixLength { get; set; } + + /// + /// The term to match. + /// + [JsonInclude, JsonPropertyName("term")] + public string Term { get; set; } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + [JsonInclude, JsonPropertyName("transpositions")] + public bool? Transpositions { get; set; } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ [JsonInclude, JsonPropertyName("use_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } +} + +public sealed partial class IntervalsFuzzyDescriptor : SerializableDescriptor> +{ + internal IntervalsFuzzyDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsFuzzyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string TermValue { get; set; } + private bool? TranspositionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to normalize the term. + /// + public IntervalsFuzzyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public IntervalsFuzzyDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public IntervalsFuzzyDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// The term to match. + /// + public IntervalsFuzzyDescriptor Term(string term) + { + TermValue = term; + return Self; + } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public IntervalsFuzzyDescriptor Transpositions(bool? transpositions = true) + { + TranspositionsValue = transpositions; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsFuzzyDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsFuzzyDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("term"); + writer.WriteStringValue(TermValue); + if (TranspositionsValue.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(TranspositionsValue.Value); + } + + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsFuzzyDescriptor : SerializableDescriptor +{ + internal IntervalsFuzzyDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsFuzzyDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string TermValue { get; set; } + private bool? TranspositionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to normalize the term. + /// + public IntervalsFuzzyDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public IntervalsFuzzyDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Number of beginning characters left unchanged when creating expansions. + /// + public IntervalsFuzzyDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// The term to match. + /// + public IntervalsFuzzyDescriptor Term(string term) + { + TermValue = term; + return Self; + } + + /// + /// Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public IntervalsFuzzyDescriptor Transpositions(bool? transpositions = true) + { + TranspositionsValue = transpositions; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsFuzzyDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsFuzzyDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsFuzzyDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("term"); + writer.WriteStringValue(TermValue); + if (TranspositionsValue.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(TranspositionsValue.Value); + } + + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs new file mode 100644 index 00000000000..4a095aa4dff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs @@ -0,0 +1,370 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsMatch +{ + /// + /// Analyzer used to analyze terms in the query. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// An optional interval filter. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? Filter { get; set; } + + /// + /// Maximum number of positions between the matching terms.
Terms further apart than this are not considered matches.
+ ///
+ [JsonInclude, JsonPropertyName("max_gaps")] + public int? MaxGaps { get; set; } + + /// + /// If `true`, matching terms must appear in their specified order. + /// + [JsonInclude, JsonPropertyName("ordered")] + public bool? Ordered { get; set; } + + /// + /// Text you wish to find in the provided field. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ [JsonInclude, JsonPropertyName("use_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } +} + +public sealed partial class IntervalsMatchDescriptor : SerializableDescriptor> +{ + internal IntervalsMatchDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsMatchDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MaxGapsValue { get; set; } + private bool? OrderedValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze terms in the query. + /// + public IntervalsMatchDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// An optional interval filter. + /// + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsMatchDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of positions between the matching terms.
Terms further apart than this are not considered matches.
+ ///
+ public IntervalsMatchDescriptor MaxGaps(int? maxGaps) + { + MaxGapsValue = maxGaps; + return Self; + } + + /// + /// If `true`, matching terms must appear in their specified order. + /// + public IntervalsMatchDescriptor Ordered(bool? ordered = true) + { + OrderedValue = ordered; + return Self; + } + + /// + /// Text you wish to find in the provided field. + /// + public IntervalsMatchDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsMatchDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsMatchDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MaxGapsValue.HasValue) + { + writer.WritePropertyName("max_gaps"); + writer.WriteNumberValue(MaxGapsValue.Value); + } + + if (OrderedValue.HasValue) + { + writer.WritePropertyName("ordered"); + writer.WriteBooleanValue(OrderedValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsMatchDescriptor : SerializableDescriptor +{ + internal IntervalsMatchDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsMatchDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } + private IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MaxGapsValue { get; set; } + private bool? OrderedValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze terms in the query. + /// + public IntervalsMatchDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// An optional interval filter. + /// + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public IntervalsMatchDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// Maximum number of positions between the matching terms.
Terms further apart than this are not considered matches.
+ ///
+ public IntervalsMatchDescriptor MaxGaps(int? maxGaps) + { + MaxGapsValue = maxGaps; + return Self; + } + + /// + /// If `true`, matching terms must appear in their specified order. + /// + public IntervalsMatchDescriptor Ordered(bool? ordered = true) + { + OrderedValue = ordered; + return Self; + } + + /// + /// Text you wish to find in the provided field. + /// + public IntervalsMatchDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsMatchDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsMatchDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsMatchDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (FilterDescriptor is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterDescriptor, options); + } + else if (FilterDescriptorAction is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MaxGapsValue.HasValue) + { + writer.WritePropertyName("max_gaps"); + writer.WriteNumberValue(MaxGapsValue.Value); + } + + if (OrderedValue.HasValue) + { + writer.WritePropertyName("ordered"); + writer.WriteBooleanValue(OrderedValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs new file mode 100644 index 00000000000..34e8838333c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsPrefix +{ + /// + /// Analyzer used to analyze the `prefix`. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// Beginning characters of terms you wish to find in the top-level field. + /// + [JsonInclude, JsonPropertyName("prefix")] + public string Prefix { get; set; } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ [JsonInclude, JsonPropertyName("use_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } +} + +public sealed partial class IntervalsPrefixDescriptor : SerializableDescriptor> +{ + internal IntervalsPrefixDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsPrefixDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private string PrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze the `prefix`. + /// + public IntervalsPrefixDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Beginning characters of terms you wish to find in the top-level field. + /// + public IntervalsPrefixDescriptor Prefix(string prefix) + { + PrefixValue = prefix; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsPrefixDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsPrefixDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsPrefixDescriptor : SerializableDescriptor +{ + internal IntervalsPrefixDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsPrefixDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private string PrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze the `prefix`. + /// + public IntervalsPrefixDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Beginning characters of terms you wish to find in the top-level field. + /// + public IntervalsPrefixDescriptor Prefix(string prefix) + { + PrefixValue = prefix; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsPrefixDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsPrefixDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsPrefixDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("prefix"); + writer.WriteStringValue(PrefixValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs new file mode 100644 index 00000000000..a6f464dd6ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs @@ -0,0 +1,466 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(IntervalsQueryConverter))] +public sealed partial class IntervalsQuery : SearchQuery +{ + internal object Variant { get; } + + internal IntervalsQuery(Field field, string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + if (field is null) + throw new ArgumentNullException(nameof(field)); + VariantName = variantName; + Variant = variant; + Field = field; + } + + internal string VariantName { get; } + + public static IntervalsQuery AllOf(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => new IntervalsQuery(field, "all_of", intervalsAllOf); + public static IntervalsQuery AnyOf(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => new IntervalsQuery(field, "any_of", intervalsAnyOf); + public static IntervalsQuery Fuzzy(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => new IntervalsQuery(field, "fuzzy", intervalsFuzzy); + public static IntervalsQuery Match(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => new IntervalsQuery(field, "match", intervalsMatch); + public static IntervalsQuery Prefix(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => new IntervalsQuery(field, "prefix", intervalsPrefix); + public static IntervalsQuery Wildcard(Field field, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsWildcard intervalsWildcard) => new IntervalsQuery(field, "wildcard", intervalsWildcard); + + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(IntervalsQuery intervalsQuery) => QueryDsl.Query.Intervals(intervalsQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("intervals", this); +} + +internal sealed partial class IntervalsQueryConverter : JsonConverter +{ + public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var fieldName = reader.GetString(); + reader.Read(); + object? variantValue = default; + string? variantNameValue = default; + string? nameValue = default; + float? boostValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "_name") + { + nameValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "boost") + { + boostValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "all_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "any_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "fuzzy") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "wildcard") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IntervalsQuery' from the response."); + } + + reader.Read(); + var result = new IntervalsQuery(fieldName, variantNameValue, variantValue); + result.QueryName = nameValue; + result.Boost = boostValue; + return result; + } + + public override void Write(Utf8JsonWriter writer, IntervalsQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize IntervalsQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "all_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf)value.Variant, options); + break; + case "any_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf)value.Variant, options); + break; + case "fuzzy": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy)value.Variant, options); + break; + case "match": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch)value.Variant, options); + break; + case "prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix)value.Variant, options); + break; + case "wildcard": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsWildcard)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +public sealed partial class IntervalsQueryDescriptor : SerializableDescriptor> +{ + internal IntervalsQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal IntervalsQueryDescriptor() : base() + { + } + + public IntervalsQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public IntervalsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public IntervalsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public IntervalsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public IntervalsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public IntervalsQueryDescriptor AllOf(IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(IntervalsWildcard intervalsWildcard) => Set(intervalsWildcard, "wildcard"); + public IntervalsQueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsQueryDescriptor : SerializableDescriptor +{ + internal IntervalsQueryDescriptor(Action configure) => configure.Invoke(this); + + internal IntervalsQueryDescriptor() : base() + { + } + + public IntervalsQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IntervalsQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private IntervalsQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public IntervalsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public IntervalsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public IntervalsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public IntervalsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public IntervalsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public IntervalsQueryDescriptor AllOf(IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(IntervalsWildcard intervalsWildcard) => Set(intervalsWildcard, "wildcard"); + public IntervalsQueryDescriptor Wildcard(Action configure) => Set(configure, "wildcard"); + public IntervalsQueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs new file mode 100644 index 00000000000..dc2f2fbfaae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class IntervalsWildcard +{ + /// + /// Analyzer used to analyze the `pattern`.
Defaults to the top-level field's analyzer.
+ ///
+ [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// Wildcard pattern used to find matching terms. + /// + [JsonInclude, JsonPropertyName("pattern")] + public string Pattern { get; set; } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ [JsonInclude, JsonPropertyName("use_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } +} + +public sealed partial class IntervalsWildcardDescriptor : SerializableDescriptor> +{ + internal IntervalsWildcardDescriptor(Action> configure) => configure.Invoke(this); + + public IntervalsWildcardDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private string PatternValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze the `pattern`.
Defaults to the top-level field's analyzer.
+ ///
+ public IntervalsWildcardDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Wildcard pattern used to find matching terms. + /// + public IntervalsWildcardDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsWildcardDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsWildcardDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IntervalsWildcardDescriptor : SerializableDescriptor +{ + internal IntervalsWildcardDescriptor(Action configure) => configure.Invoke(this); + + public IntervalsWildcardDescriptor() : base() + { + } + + private string? AnalyzerValue { get; set; } + private string PatternValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? UseFieldValue { get; set; } + + /// + /// Analyzer used to analyze the `pattern`.
Defaults to the top-level field's analyzer.
+ ///
+ public IntervalsWildcardDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Wildcard pattern used to find matching terms. + /// + public IntervalsWildcardDescriptor Pattern(string pattern) + { + PatternValue = pattern; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsWildcardDescriptor UseField(Elastic.Clients.Elasticsearch.Serverless.Field? useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsWildcardDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + /// + /// If specified, match intervals from this field rather than the top-level field.
The `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately.
+ ///
+ public IntervalsWildcardDescriptor UseField(Expression> useField) + { + UseFieldValue = useField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + writer.WritePropertyName("pattern"); + writer.WriteStringValue(PatternValue); + if (UseFieldValue is not null) + { + writer.WritePropertyName("use_field"); + JsonSerializer.Serialize(writer, UseFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs new file mode 100644 index 00000000000..8c57686c5b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class Like : Union +{ + public Like(string text) : base(text) + { + } + + public Like(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.LikeDocument document) : base(document) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs new file mode 100644 index 00000000000..95679f8513c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs @@ -0,0 +1,317 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class LikeDocument +{ + /// + /// ID of a document. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// Index of a document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// A document not present in the index. + /// + [JsonInclude, JsonPropertyName("doc")] + public object? Doc { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public Fields? Fields { get; set; } + [JsonInclude, JsonPropertyName("per_field_analyzer")] + public IDictionary? PerFieldAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + [JsonInclude, JsonPropertyName("version_type")] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get; set; } +} + +public sealed partial class LikeDocumentDescriptor : SerializableDescriptor> +{ + internal LikeDocumentDescriptor(Action> configure) => configure.Invoke(this); + + public LikeDocumentDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private object? DocValue { get; set; } + private Fields? FieldsValue { get; set; } + private IDictionary? PerFieldAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + /// + /// ID of a document. + /// + public LikeDocumentDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Index of a document. + /// + public LikeDocumentDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// A document not present in the index. + /// + public LikeDocumentDescriptor Doc(object? doc) + { + DocValue = doc; + return Self; + } + + public LikeDocumentDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public LikeDocumentDescriptor PerFieldAnalyzer(Func, FluentDictionary> selector) + { + PerFieldAnalyzerValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LikeDocumentDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + public LikeDocumentDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public LikeDocumentDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + JsonSerializer.Serialize(writer, DocValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (PerFieldAnalyzerValue is not null) + { + writer.WritePropertyName("per_field_analyzer"); + JsonSerializer.Serialize(writer, PerFieldAnalyzerValue, options); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class LikeDocumentDescriptor : SerializableDescriptor +{ + internal LikeDocumentDescriptor(Action configure) => configure.Invoke(this); + + public LikeDocumentDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private object? DocValue { get; set; } + private Fields? FieldsValue { get; set; } + private IDictionary? PerFieldAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + /// + /// ID of a document. + /// + public LikeDocumentDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Index of a document. + /// + public LikeDocumentDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// A document not present in the index. + /// + public LikeDocumentDescriptor Doc(object? doc) + { + DocValue = doc; + return Self; + } + + public LikeDocumentDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + public LikeDocumentDescriptor PerFieldAnalyzer(Func, FluentDictionary> selector) + { + PerFieldAnalyzerValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public LikeDocumentDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + public LikeDocumentDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public LikeDocumentDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IdValue is not null) + { + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (DocValue is not null) + { + writer.WritePropertyName("doc"); + JsonSerializer.Serialize(writer, DocValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (PerFieldAnalyzerValue is not null) + { + writer.WritePropertyName("per_field_analyzer"); + JsonSerializer.Serialize(writer, PerFieldAnalyzerValue, options); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs new file mode 100644 index 00000000000..f1b5e1e2fe5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs @@ -0,0 +1,82 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class MatchAllQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + public static implicit operator Query(MatchAllQuery matchAllQuery) => QueryDsl.Query.MatchAll(matchAllQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_all", this); +} + +public sealed partial class MatchAllQueryDescriptor : SerializableDescriptor +{ + internal MatchAllQueryDescriptor(Action configure) => configure.Invoke(this); + + public MatchAllQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + public MatchAllQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public MatchAllQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs new file mode 100644 index 00000000000..2a16d1dde62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs @@ -0,0 +1,686 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class MatchBoolPrefixQueryConverter : JsonConverter +{ + public override MatchBoolPrefixQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new MatchBoolPrefixQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "analyzer") + { + variant.Analyzer = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzziness") + { + variant.Fuzziness = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzzy_rewrite") + { + variant.FuzzyRewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzzy_transpositions") + { + variant.FuzzyTranspositions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_expansions") + { + variant.MaxExpansions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "minimum_should_match") + { + variant.MinimumShouldMatch = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "operator") + { + variant.Operator = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prefix_length") + { + variant.PrefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, MatchBoolPrefixQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize MatchBoolPrefixQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (!string.IsNullOrEmpty(value.Analyzer)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } + + if (value.FuzzyRewrite is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); + } + + if (value.FuzzyTranspositions.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(value.FuzzyTranspositions.Value); + } + + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } + + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } + + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } + + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(MatchBoolPrefixQueryConverter))] +public sealed partial class MatchBoolPrefixQuery : SearchQuery +{ + public MatchBoolPrefixQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public string? Analyzer { get; set; } + public float? Boost { get; set; } + + /// + /// Maximum edit distance allowed for matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Method used to rewrite the query.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public string? FuzzyRewrite { get; set; } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public bool? FuzzyTranspositions { get; set; } + + /// + /// Maximum number of terms to which the query will expand.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public int? MaxExpansions { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned.
Applied to the constructed bool query.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Boolean logic used to interpret text in the query value.
Applied to the constructed bool query.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? Operator { get; set; } + + /// + /// Number of beginning characters left unchanged for fuzzy matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public int? PrefixLength { get; set; } + + /// + /// Terms you wish to find in the provided field.
The last term is used in a prefix query.
+ ///
+ public string Query { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(MatchBoolPrefixQuery matchBoolPrefixQuery) => QueryDsl.Query.MatchBoolPrefix(matchBoolPrefixQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_bool_prefix", this); +} + +public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescriptor> +{ + internal MatchBoolPrefixQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal MatchBoolPrefixQueryDescriptor() : base() + { + } + + public MatchBoolPrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public MatchBoolPrefixQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + + public MatchBoolPrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned.
Applied to the constructed bool query.
+ ///
+ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value.
Applied to the constructed bool query.
+ ///
+ public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Terms you wish to find in the provided field.
The last term is used in a prefix query.
+ ///
+ public MatchBoolPrefixQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescriptor +{ + internal MatchBoolPrefixQueryDescriptor(Action configure) => configure.Invoke(this); + + internal MatchBoolPrefixQueryDescriptor() : base() + { + } + + public MatchBoolPrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + + public MatchBoolPrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MatchBoolPrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned.
Applied to the constructed bool query.
+ ///
+ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value.
Applied to the constructed bool query.
+ ///
+ public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching.
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MatchBoolPrefixQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Terms you wish to find in the provided field.
The last term is used in a prefix query.
+ ///
+ public MatchBoolPrefixQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs new file mode 100644 index 00000000000..7d149a361d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs @@ -0,0 +1,82 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class MatchNoneQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + public static implicit operator Query(MatchNoneQuery matchNoneQuery) => QueryDsl.Query.MatchNone(matchNoneQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_none", this); +} + +public sealed partial class MatchNoneQueryDescriptor : SerializableDescriptor +{ + internal MatchNoneQueryDescriptor(Action configure) => configure.Invoke(this); + + public MatchNoneQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + public MatchNoneQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public MatchNoneQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs new file mode 100644 index 00000000000..7bcae1745ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs @@ -0,0 +1,490 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class MatchPhrasePrefixQueryConverter : JsonConverter +{ + public override MatchPhrasePrefixQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new MatchPhrasePrefixQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "analyzer") + { + variant.Analyzer = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_expansions") + { + variant.MaxExpansions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "slop") + { + variant.Slop = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "zero_terms_query") + { + variant.ZeroTermsQuery = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, MatchPhrasePrefixQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize MatchPhrasePrefixQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (!string.IsNullOrEmpty(value.Analyzer)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } + + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(MatchPhrasePrefixQueryConverter))] +public sealed partial class MatchPhrasePrefixQuery : SearchQuery +{ + public MatchPhrasePrefixQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + + /// + /// Analyzer used to convert text in the query value into tokens. + /// + public string? Analyzer { get; set; } + public float? Boost { get; set; } + + /// + /// Maximum number of terms to which the last provided term of the query value will expand. + /// + public int? MaxExpansions { get; set; } + + /// + /// Text you wish to find in the provided field. + /// + public string Query { get; set; } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public int? Slop { get; set; } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(MatchPhrasePrefixQuery matchPhrasePrefixQuery) => QueryDsl.Query.MatchPhrasePrefix(matchPhrasePrefixQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_phrase_prefix", this); +} + +public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescriptor> +{ + internal MatchPhrasePrefixQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal MatchPhrasePrefixQueryDescriptor() : base() + { + } + + public MatchPhrasePrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public MatchPhrasePrefixQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchPhrasePrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert text in the query value into tokens. + /// + public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum number of terms to which the last provided term of the query value will expand. + /// + public MatchPhrasePrefixQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Text you wish to find in the provided field. + /// + public MatchPhrasePrefixQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MatchPhrasePrefixQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + public MatchPhrasePrefixQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescriptor +{ + internal MatchPhrasePrefixQueryDescriptor(Action configure) => configure.Invoke(this); + + internal MatchPhrasePrefixQueryDescriptor() : base() + { + } + + public MatchPhrasePrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchPhrasePrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert text in the query value into tokens. + /// + public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MatchPhrasePrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum number of terms to which the last provided term of the query value will expand. + /// + public MatchPhrasePrefixQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Text you wish to find in the provided field. + /// + public MatchPhrasePrefixQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MatchPhrasePrefixQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. + /// + public MatchPhrasePrefixQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs new file mode 100644 index 00000000000..f9880212b74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs @@ -0,0 +1,441 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class MatchPhraseQueryConverter : JsonConverter +{ + public override MatchPhraseQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new MatchPhraseQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "analyzer") + { + variant.Analyzer = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "slop") + { + variant.Slop = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "zero_terms_query") + { + variant.ZeroTermsQuery = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, MatchPhraseQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize MatchPhraseQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (!string.IsNullOrEmpty(value.Analyzer)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } + + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(MatchPhraseQueryConverter))] +public sealed partial class MatchPhraseQuery : SearchQuery +{ + public MatchPhraseQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public string? Analyzer { get; set; } + public float? Boost { get; set; } + + /// + /// Query terms that are analyzed and turned into a phrase query. + /// + public string Query { get; set; } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public int? Slop { get; set; } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(MatchPhraseQuery matchPhraseQuery) => QueryDsl.Query.MatchPhrase(matchPhraseQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_phrase", this); +} + +public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor> +{ + internal MatchPhraseQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal MatchPhraseQueryDescriptor() : base() + { + } + + public MatchPhraseQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public MatchPhraseQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchPhraseQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchPhraseQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchPhraseQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchPhraseQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchPhraseQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Query terms that are analyzed and turned into a phrase query. + /// + public MatchPhraseQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MatchPhraseQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MatchPhraseQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor +{ + internal MatchPhraseQueryDescriptor(Action configure) => configure.Invoke(this); + + internal MatchPhraseQueryDescriptor() : base() + { + } + + public MatchPhraseQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchPhraseQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchPhraseQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MatchPhraseQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchPhraseQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchPhraseQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MatchPhraseQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Query terms that are analyzed and turned into a phrase query. + /// + public MatchPhraseQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MatchPhraseQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MatchPhraseQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs new file mode 100644 index 00000000000..119f4a9574f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs @@ -0,0 +1,833 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class MatchQueryConverter : JsonConverter +{ + public override MatchQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new MatchQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "analyzer") + { + variant.Analyzer = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "auto_generate_synonyms_phrase_query") + { + variant.AutoGenerateSynonymsPhraseQuery = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzziness") + { + variant.Fuzziness = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzzy_rewrite") + { + variant.FuzzyRewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "fuzzy_transpositions") + { + variant.FuzzyTranspositions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lenient") + { + variant.Lenient = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_expansions") + { + variant.MaxExpansions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "minimum_should_match") + { + variant.MinimumShouldMatch = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "operator") + { + variant.Operator = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prefix_length") + { + variant.PrefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "zero_terms_query") + { + variant.ZeroTermsQuery = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, MatchQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize MatchQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (!string.IsNullOrEmpty(value.Analyzer)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } + + if (value.AutoGenerateSynonymsPhraseQuery.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(value.AutoGenerateSynonymsPhraseQuery.Value); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } + + if (value.FuzzyRewrite is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); + } + + if (value.FuzzyTranspositions.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(value.FuzzyTranspositions.Value); + } + + if (value.Lenient.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(value.Lenient.Value); + } + + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } + + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } + + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } + + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } + + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(MatchQueryConverter))] +public sealed partial class MatchQuery : SearchQuery +{ + public MatchQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public string? Analyzer { get; set; } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + public float? Boost { get; set; } + + /// + /// Maximum edit distance allowed for matching. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Method used to rewrite the query. + /// + public string? FuzzyRewrite { get; set; } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public bool? FuzzyTranspositions { get; set; } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + public bool? Lenient { get; set; } + + /// + /// Maximum number of terms to which the query will expand. + /// + public int? MaxExpansions { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? Operator { get; set; } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public int? PrefixLength { get; set; } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + public string Query { get; set; } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(MatchQuery matchQuery) => QueryDsl.Query.Match(matchQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match", this); +} + +public sealed partial class MatchQueryDescriptor : SerializableDescriptor> +{ + internal MatchQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal MatchQueryDescriptor() : base() + { + } + + public MatchQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public MatchQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public MatchQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public MatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public MatchQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public MatchQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + public MatchQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand. + /// + public MatchQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public MatchQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + public MatchQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MatchQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class MatchQueryDescriptor : SerializableDescriptor +{ + internal MatchQueryDescriptor(Action configure) => configure.Invoke(this); + + internal MatchQueryDescriptor() : base() + { + } + + public MatchQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MatchQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MatchQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public MatchQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public MatchQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public MatchQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public MatchQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public MatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public MatchQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public MatchQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + public MatchQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand. + /// + public MatchQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public MatchQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + public MatchQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MatchQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs new file mode 100644 index 00000000000..7274defe518 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -0,0 +1,809 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class MoreLikeThisQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// The analyzer that is used to analyze the free form text.
Defaults to the analyzer associated with the first field in fields.
+ ///
+ [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Each term in the formed query could be further boosted by their tf-idf score.
This sets the boost factor to use when using this feature.
Defaults to deactivated (0).
+ ///
+ [JsonInclude, JsonPropertyName("boost_terms")] + public double? BoostTerms { get; set; } + + /// + /// Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`). + /// + [JsonInclude, JsonPropertyName("fail_on_unsupported_field")] + public bool? FailOnUnsupportedField { get; set; } + + /// + /// A list of fields to fetch and analyze the text from.
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Fields? Fields { get; set; } + + /// + /// Specifies whether the input documents should also be included in the search results returned. + /// + [JsonInclude, JsonPropertyName("include")] + public bool? Include { get; set; } + + /// + /// Specifies free form text and/or a single or multiple documents for which you want to find similar documents. + /// + [JsonInclude, JsonPropertyName("like"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Like))] + public ICollection Like { get; set; } + + /// + /// The maximum document frequency above which the terms are ignored from the input document. + /// + [JsonInclude, JsonPropertyName("max_doc_freq")] + public int? MaxDocFreq { get; set; } + + /// + /// The maximum number of query terms that can be selected. + /// + [JsonInclude, JsonPropertyName("max_query_terms")] + public int? MaxQueryTerms { get; set; } + + /// + /// The maximum word length above which the terms are ignored.
Defaults to unbounded (`0`).
+ ///
+ [JsonInclude, JsonPropertyName("max_word_length")] + public int? MaxWordLength { get; set; } + + /// + /// The minimum document frequency below which the terms are ignored from the input document. + /// + [JsonInclude, JsonPropertyName("min_doc_freq")] + public int? MinDocFreq { get; set; } + + /// + /// The minimum term frequency below which the terms are ignored from the input document. + /// + [JsonInclude, JsonPropertyName("min_term_freq")] + public int? MinTermFreq { get; set; } + + /// + /// The minimum word length below which the terms are ignored. + /// + [JsonInclude, JsonPropertyName("min_word_length")] + public int? MinWordLength { get; set; } + + /// + /// After the disjunctive query has been formed, this parameter controls the number of terms that must match. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Overrides the default analyzer. + /// + [JsonInclude, JsonPropertyName("per_field_analyzer")] + public IDictionary? PerFieldAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// An array of stop words.
Any word in this set is ignored.
+ ///
+ [JsonInclude, JsonPropertyName("stop_words")] + [JsonConverter(typeof(StopWordsConverter))] + public ICollection? StopWords { get; set; } + + /// + /// Used in combination with `like` to exclude documents that match a set of terms. + /// + [JsonInclude, JsonPropertyName("unlike"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Like))] + public ICollection? Unlike { get; set; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + [JsonInclude, JsonPropertyName("version_type")] + public Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionType { get; set; } + + public static implicit operator Query(MoreLikeThisQuery moreLikeThisQuery) => QueryDsl.Query.MoreLikeThis(moreLikeThisQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("more_like_this", this); +} + +public sealed partial class MoreLikeThisQueryDescriptor : SerializableDescriptor> +{ + internal MoreLikeThisQueryDescriptor(Action> configure) => configure.Invoke(this); + + public MoreLikeThisQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private double? BoostTermsValue { get; set; } + private bool? FailOnUnsupportedFieldValue { get; set; } + private Fields? FieldsValue { get; set; } + private bool? IncludeValue { get; set; } + private ICollection LikeValue { get; set; } + private int? MaxDocFreqValue { get; set; } + private int? MaxQueryTermsValue { get; set; } + private int? MaxWordLengthValue { get; set; } + private int? MinDocFreqValue { get; set; } + private int? MinTermFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private IDictionary? PerFieldAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private ICollection? StopWordsValue { get; set; } + private ICollection? UnlikeValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + public MoreLikeThisQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The analyzer that is used to analyze the free form text.
Defaults to the analyzer associated with the first field in fields.
+ ///
+ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MoreLikeThisQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Each term in the formed query could be further boosted by their tf-idf score.
This sets the boost factor to use when using this feature.
Defaults to deactivated (0).
+ ///
+ public MoreLikeThisQueryDescriptor BoostTerms(double? boostTerms) + { + BoostTermsValue = boostTerms; + return Self; + } + + /// + /// Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`). + /// + public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failOnUnsupportedField = true) + { + FailOnUnsupportedFieldValue = failOnUnsupportedField; + return Self; + } + + /// + /// A list of fields to fetch and analyze the text from.
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public MoreLikeThisQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Specifies whether the input documents should also be included in the search results returned. + /// + public MoreLikeThisQueryDescriptor Include(bool? include = true) + { + IncludeValue = include; + return Self; + } + + /// + /// Specifies free form text and/or a single or multiple documents for which you want to find similar documents. + /// + public MoreLikeThisQueryDescriptor Like(ICollection like) + { + LikeValue = like; + return Self; + } + + /// + /// The maximum document frequency above which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MaxDocFreq(int? maxDocFreq) + { + MaxDocFreqValue = maxDocFreq; + return Self; + } + + /// + /// The maximum number of query terms that can be selected. + /// + public MoreLikeThisQueryDescriptor MaxQueryTerms(int? maxQueryTerms) + { + MaxQueryTermsValue = maxQueryTerms; + return Self; + } + + /// + /// The maximum word length above which the terms are ignored.
Defaults to unbounded (`0`).
+ ///
+ public MoreLikeThisQueryDescriptor MaxWordLength(int? maxWordLength) + { + MaxWordLengthValue = maxWordLength; + return Self; + } + + /// + /// The minimum document frequency below which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MinDocFreq(int? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + /// + /// The minimum term frequency below which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MinTermFreq(int? minTermFreq) + { + MinTermFreqValue = minTermFreq; + return Self; + } + + /// + /// The minimum word length below which the terms are ignored. + /// + public MoreLikeThisQueryDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + /// + /// After the disjunctive query has been formed, this parameter controls the number of terms that must match. + /// + public MoreLikeThisQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Overrides the default analyzer. + /// + public MoreLikeThisQueryDescriptor PerFieldAnalyzer(Func, FluentDictionary> selector) + { + PerFieldAnalyzerValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MoreLikeThisQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// An array of stop words.
Any word in this set is ignored.
+ ///
+ public MoreLikeThisQueryDescriptor StopWords(ICollection? stopWords) + { + StopWordsValue = stopWords; + return Self; + } + + /// + /// Used in combination with `like` to exclude documents that match a set of terms. + /// + public MoreLikeThisQueryDescriptor Unlike(ICollection? unlike) + { + UnlikeValue = unlike; + return Self; + } + + public MoreLikeThisQueryDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MoreLikeThisQueryDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (BoostTermsValue.HasValue) + { + writer.WritePropertyName("boost_terms"); + writer.WriteNumberValue(BoostTermsValue.Value); + } + + if (FailOnUnsupportedFieldValue.HasValue) + { + writer.WritePropertyName("fail_on_unsupported_field"); + writer.WriteBooleanValue(FailOnUnsupportedFieldValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IncludeValue.HasValue) + { + writer.WritePropertyName("include"); + writer.WriteBooleanValue(IncludeValue.Value); + } + + writer.WritePropertyName("like"); + SingleOrManySerializationHelper.Serialize(LikeValue, writer, options); + if (MaxDocFreqValue.HasValue) + { + writer.WritePropertyName("max_doc_freq"); + writer.WriteNumberValue(MaxDocFreqValue.Value); + } + + if (MaxQueryTermsValue.HasValue) + { + writer.WritePropertyName("max_query_terms"); + writer.WriteNumberValue(MaxQueryTermsValue.Value); + } + + if (MaxWordLengthValue.HasValue) + { + writer.WritePropertyName("max_word_length"); + writer.WriteNumberValue(MaxWordLengthValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinTermFreqValue.HasValue) + { + writer.WritePropertyName("min_term_freq"); + writer.WriteNumberValue(MinTermFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (PerFieldAnalyzerValue is not null) + { + writer.WritePropertyName("per_field_analyzer"); + JsonSerializer.Serialize(writer, PerFieldAnalyzerValue, options); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (StopWordsValue is not null) + { + writer.WritePropertyName("stop_words"); + SingleOrManySerializationHelper.Serialize(StopWordsValue, writer, options); + } + + if (UnlikeValue is not null) + { + writer.WritePropertyName("unlike"); + SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MoreLikeThisQueryDescriptor : SerializableDescriptor +{ + internal MoreLikeThisQueryDescriptor(Action configure) => configure.Invoke(this); + + public MoreLikeThisQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private float? BoostValue { get; set; } + private double? BoostTermsValue { get; set; } + private bool? FailOnUnsupportedFieldValue { get; set; } + private Fields? FieldsValue { get; set; } + private bool? IncludeValue { get; set; } + private ICollection LikeValue { get; set; } + private int? MaxDocFreqValue { get; set; } + private int? MaxQueryTermsValue { get; set; } + private int? MaxWordLengthValue { get; set; } + private int? MinDocFreqValue { get; set; } + private int? MinTermFreqValue { get; set; } + private int? MinWordLengthValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private IDictionary? PerFieldAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private ICollection? StopWordsValue { get; set; } + private ICollection? UnlikeValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.VersionType? VersionTypeValue { get; set; } + + public MoreLikeThisQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The analyzer that is used to analyze the free form text.
Defaults to the analyzer associated with the first field in fields.
+ ///
+ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + public MoreLikeThisQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Each term in the formed query could be further boosted by their tf-idf score.
This sets the boost factor to use when using this feature.
Defaults to deactivated (0).
+ ///
+ public MoreLikeThisQueryDescriptor BoostTerms(double? boostTerms) + { + BoostTermsValue = boostTerms; + return Self; + } + + /// + /// Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`). + /// + public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failOnUnsupportedField = true) + { + FailOnUnsupportedFieldValue = failOnUnsupportedField; + return Self; + } + + /// + /// A list of fields to fetch and analyze the text from.
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public MoreLikeThisQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Specifies whether the input documents should also be included in the search results returned. + /// + public MoreLikeThisQueryDescriptor Include(bool? include = true) + { + IncludeValue = include; + return Self; + } + + /// + /// Specifies free form text and/or a single or multiple documents for which you want to find similar documents. + /// + public MoreLikeThisQueryDescriptor Like(ICollection like) + { + LikeValue = like; + return Self; + } + + /// + /// The maximum document frequency above which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MaxDocFreq(int? maxDocFreq) + { + MaxDocFreqValue = maxDocFreq; + return Self; + } + + /// + /// The maximum number of query terms that can be selected. + /// + public MoreLikeThisQueryDescriptor MaxQueryTerms(int? maxQueryTerms) + { + MaxQueryTermsValue = maxQueryTerms; + return Self; + } + + /// + /// The maximum word length above which the terms are ignored.
Defaults to unbounded (`0`).
+ ///
+ public MoreLikeThisQueryDescriptor MaxWordLength(int? maxWordLength) + { + MaxWordLengthValue = maxWordLength; + return Self; + } + + /// + /// The minimum document frequency below which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MinDocFreq(int? minDocFreq) + { + MinDocFreqValue = minDocFreq; + return Self; + } + + /// + /// The minimum term frequency below which the terms are ignored from the input document. + /// + public MoreLikeThisQueryDescriptor MinTermFreq(int? minTermFreq) + { + MinTermFreqValue = minTermFreq; + return Self; + } + + /// + /// The minimum word length below which the terms are ignored. + /// + public MoreLikeThisQueryDescriptor MinWordLength(int? minWordLength) + { + MinWordLengthValue = minWordLength; + return Self; + } + + /// + /// After the disjunctive query has been formed, this parameter controls the number of terms that must match. + /// + public MoreLikeThisQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Overrides the default analyzer. + /// + public MoreLikeThisQueryDescriptor PerFieldAnalyzer(Func, FluentDictionary> selector) + { + PerFieldAnalyzerValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MoreLikeThisQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// An array of stop words.
Any word in this set is ignored.
+ ///
+ public MoreLikeThisQueryDescriptor StopWords(ICollection? stopWords) + { + StopWordsValue = stopWords; + return Self; + } + + /// + /// Used in combination with `like` to exclude documents that match a set of terms. + /// + public MoreLikeThisQueryDescriptor Unlike(ICollection? unlike) + { + UnlikeValue = unlike; + return Self; + } + + public MoreLikeThisQueryDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MoreLikeThisQueryDescriptor VersionType(Elastic.Clients.Elasticsearch.Serverless.VersionType? versionType) + { + VersionTypeValue = versionType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (BoostTermsValue.HasValue) + { + writer.WritePropertyName("boost_terms"); + writer.WriteNumberValue(BoostTermsValue.Value); + } + + if (FailOnUnsupportedFieldValue.HasValue) + { + writer.WritePropertyName("fail_on_unsupported_field"); + writer.WriteBooleanValue(FailOnUnsupportedFieldValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (IncludeValue.HasValue) + { + writer.WritePropertyName("include"); + writer.WriteBooleanValue(IncludeValue.Value); + } + + writer.WritePropertyName("like"); + SingleOrManySerializationHelper.Serialize(LikeValue, writer, options); + if (MaxDocFreqValue.HasValue) + { + writer.WritePropertyName("max_doc_freq"); + writer.WriteNumberValue(MaxDocFreqValue.Value); + } + + if (MaxQueryTermsValue.HasValue) + { + writer.WritePropertyName("max_query_terms"); + writer.WriteNumberValue(MaxQueryTermsValue.Value); + } + + if (MaxWordLengthValue.HasValue) + { + writer.WritePropertyName("max_word_length"); + writer.WriteNumberValue(MaxWordLengthValue.Value); + } + + if (MinDocFreqValue.HasValue) + { + writer.WritePropertyName("min_doc_freq"); + writer.WriteNumberValue(MinDocFreqValue.Value); + } + + if (MinTermFreqValue.HasValue) + { + writer.WritePropertyName("min_term_freq"); + writer.WriteNumberValue(MinTermFreqValue.Value); + } + + if (MinWordLengthValue.HasValue) + { + writer.WritePropertyName("min_word_length"); + writer.WriteNumberValue(MinWordLengthValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (PerFieldAnalyzerValue is not null) + { + writer.WritePropertyName("per_field_analyzer"); + JsonSerializer.Serialize(writer, PerFieldAnalyzerValue, options); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (StopWordsValue is not null) + { + writer.WritePropertyName("stop_words"); + SingleOrManySerializationHelper.Serialize(StopWordsValue, writer, options); + } + + if (UnlikeValue is not null) + { + writer.WritePropertyName("unlike"); + SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs new file mode 100644 index 00000000000..ef9c922804b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs @@ -0,0 +1,724 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class MultiMatchQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + [JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] + public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The fields to be queried.
Defaults to the `index.query.default_field` index settings, which in turn defaults to `*`.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + + /// + /// Maximum edit distance allowed for matching. + /// + [JsonInclude, JsonPropertyName("fuzziness")] + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Method used to rewrite the query. + /// + [JsonInclude, JsonPropertyName("fuzzy_rewrite")] + public string? FuzzyRewrite { get; set; } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ [JsonInclude, JsonPropertyName("fuzzy_transpositions")] + public bool? FuzzyTranspositions { get; set; } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + [JsonInclude, JsonPropertyName("lenient")] + public bool? Lenient { get; set; } + + /// + /// Maximum number of terms to which the query will expand. + /// + [JsonInclude, JsonPropertyName("max_expansions")] + public int? MaxExpansions { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Boolean logic used to interpret text in the query value. + /// + [JsonInclude, JsonPropertyName("operator")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? Operator { get; set; } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("prefix_length")] + public int? PrefixLength { get; set; } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + [JsonInclude, JsonPropertyName("slop")] + public int? Slop { get; set; } + + /// + /// Determines how scores for each per-term blended query and scores across groups are combined. + /// + [JsonInclude, JsonPropertyName("tie_breaker")] + public double? TieBreaker { get; set; } + + /// + /// How `the` multi_match query is executed internally. + /// + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? Type { get; set; } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + [JsonInclude, JsonPropertyName("zero_terms_query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } + + public static implicit operator Query(MultiMatchQuery multiMatchQuery) => QueryDsl.Query.MultiMatch(multiMatchQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("multi_match", this); +} + +public sealed partial class MultiMatchQueryDescriptor : SerializableDescriptor> +{ + internal MultiMatchQueryDescriptor(Action> configure) => configure.Invoke(this); + + public MultiMatchQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private double? TieBreakerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? TypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MultiMatchQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MultiMatchQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public MultiMatchQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The fields to be queried.
Defaults to the `index.query.default_field` index settings, which in turn defaults to `*`.
+ ///
+ public MultiMatchQueryDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public MultiMatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public MultiMatchQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MultiMatchQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + public MultiMatchQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand. + /// + public MultiMatchQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public MultiMatchQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + public MultiMatchQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MultiMatchQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Determines how scores for each per-term blended query and scores across groups are combined. + /// + public MultiMatchQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + /// + /// How `the` multi_match query is executed internally. + /// + public MultiMatchQueryDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? type) + { + TypeValue = type; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MultiMatchQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class MultiMatchQueryDescriptor : SerializableDescriptor +{ + internal MultiMatchQueryDescriptor(Action configure) => configure.Invoke(this); + + public MultiMatchQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxExpansionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? OperatorValue { get; set; } + private int? PrefixLengthValue { get; set; } + private string QueryValue { get; set; } + private int? SlopValue { get; set; } + private double? TieBreakerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? TypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } + + public MultiMatchQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Analyzer used to convert the text in the query value into tokens. + /// + public MultiMatchQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public MultiMatchQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The fields to be queried.
Defaults to the `index.query.default_field` index settings, which in turn defaults to `*`.
+ ///
+ public MultiMatchQueryDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Maximum edit distance allowed for matching. + /// + public MultiMatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public MultiMatchQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).
Can be applied to the term subqueries constructed for all terms but the final term.
+ ///
+ public MultiMatchQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + /// + public MultiMatchQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of terms to which the query will expand. + /// + public MultiMatchQueryDescriptor MaxExpansions(int? maxExpansions) + { + MaxExpansionsValue = maxExpansions; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Boolean logic used to interpret text in the query value. + /// + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + { + OperatorValue = op; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public MultiMatchQueryDescriptor PrefixLength(int? prefixLength) + { + PrefixLengthValue = prefixLength; + return Self; + } + + /// + /// Text, number, boolean value or date you wish to find in the provided field. + /// + public MultiMatchQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens. + /// + public MultiMatchQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + /// + /// Determines how scores for each per-term blended query and scores across groups are combined. + /// + public MultiMatchQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + /// + /// How `the` multi_match query is executed internally. + /// + public MultiMatchQueryDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? type) + { + TypeValue = type; + return Self; + } + + /// + /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. + /// + public MultiMatchQueryDescriptor ZeroTermsQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? zeroTermsQuery) + { + ZeroTermsQueryValue = zeroTermsQuery; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxExpansionsValue.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(MaxExpansionsValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (OperatorValue is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + } + + if (PrefixLengthValue.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + if (ZeroTermsQueryValue is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, ZeroTermsQueryValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs new file mode 100644 index 00000000000..1cd515a37ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs @@ -0,0 +1,453 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class NestedQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Indicates whether to ignore an unmapped path and not return any documents instead of an error. + /// + [JsonInclude, JsonPropertyName("ignore_unmapped")] + public bool? IgnoreUnmapped { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + [JsonInclude, JsonPropertyName("inner_hits")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHits { get; set; } + + /// + /// Path to the nested object you wish to search. + /// + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Field Path { get; set; } + + /// + /// Query you wish to run on nested objects in the path. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// How scores for matching child objects affect the root parent document’s relevance score. + /// + [JsonInclude, JsonPropertyName("score_mode")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreMode { get; set; } + + public static implicit operator Query(NestedQuery nestedQuery) => QueryDsl.Query.Nested(nestedQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("nested", this); +} + +public sealed partial class NestedQueryDescriptor : SerializableDescriptor> +{ + internal NestedQueryDescriptor(Action> configure) => configure.Invoke(this); + + public NestedQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public NestedQueryDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on nested objects in the path. + /// + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public NestedQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public NestedQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public NestedQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public NestedQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped path and not return any documents instead of an error. + /// + public NestedQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Path to the nested object you wish to search. + /// + public NestedQueryDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + /// + /// Path to the nested object you wish to search. + /// + public NestedQueryDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + /// + /// How scores for matching child objects affect the root parent document’s relevance score. + /// + public NestedQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class NestedQueryDescriptor : SerializableDescriptor +{ + internal NestedQueryDescriptor(Action configure) => configure.Invoke(this); + + public NestedQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + + /// + /// If defined, each search hit will contain inner hits. + /// + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public NestedQueryDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + + /// + /// Query you wish to run on nested objects in the path. + /// + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public NestedQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public NestedQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public NestedQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public NestedQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped path and not return any documents instead of an error. + /// + public NestedQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Path to the nested object you wish to search. + /// + public NestedQueryDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + /// + /// Path to the nested object you wish to search. + /// + public NestedQueryDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + /// + /// Path to the nested object you wish to search. + /// + public NestedQueryDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + /// + /// How scores for matching child objects affect the root parent document’s relevance score. + /// + public NestedQueryDescriptor ScoreMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? scoreMode) + { + ScoreModeValue = scoreMode; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (InnerHitsDescriptor is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsDescriptor, options); + } + else if (InnerHitsDescriptorAction is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + if (ScoreModeValue is not null) + { + writer.WritePropertyName("score_mode"); + JsonSerializer.Serialize(writer, ScoreModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs new file mode 100644 index 00000000000..048522ae823 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -0,0 +1,570 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class NumberRangeQueryConverter : JsonConverter +{ + public override NumberRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new NumberRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, NumberRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize NumberRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Gt.HasValue) + { + writer.WritePropertyName("gt"); + writer.WriteNumberValue(value.Gt.Value); + } + + if (value.Gte.HasValue) + { + writer.WritePropertyName("gte"); + writer.WriteNumberValue(value.Gte.Value); + } + + if (value.Lt.HasValue) + { + writer.WritePropertyName("lt"); + writer.WriteNumberValue(value.Lt.Value); + } + + if (value.Lte.HasValue) + { + writer.WritePropertyName("lte"); + writer.WriteNumberValue(value.Lte.Value); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (value.To.HasValue) + { + writer.WritePropertyName("to"); + writer.WriteNumberValue(value.To.Value); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(NumberRangeQueryConverter))] +public sealed partial class NumberRangeQuery : RangeQuery +{ + public NumberRangeQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + public double? From { get; set; } + + /// + /// Greater than. + /// + public double? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public double? Gte { get; set; } + + /// + /// Less than. + /// + public double? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public double? Lte { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? Relation { get; set; } + public double? To { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(NumberRangeQuery numberRangeQuery) => QueryDsl.Query.Range(numberRangeQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("range", this); +} + +public sealed partial class NumberRangeQueryDescriptor : SerializableDescriptor> +{ + internal NumberRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal NumberRangeQueryDescriptor() : base() + { + } + + public NumberRangeQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public NumberRangeQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private double? FromValue { get; set; } + private double? GtValue { get; set; } + private double? GteValue { get; set; } + private double? LtValue { get; set; } + private double? LteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private double? ToValue { get; set; } + + public NumberRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public NumberRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public NumberRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public NumberRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumberRangeQueryDescriptor From(double? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public NumberRangeQueryDescriptor Gt(double? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public NumberRangeQueryDescriptor Gte(double? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public NumberRangeQueryDescriptor Lt(double? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public NumberRangeQueryDescriptor Lte(double? lte) + { + LteValue = lte; + return Self; + } + + public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public NumberRangeQueryDescriptor To(double? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (GtValue.HasValue) + { + writer.WritePropertyName("gt"); + writer.WriteNumberValue(GtValue.Value); + } + + if (GteValue.HasValue) + { + writer.WritePropertyName("gte"); + writer.WriteNumberValue(GteValue.Value); + } + + if (LtValue.HasValue) + { + writer.WritePropertyName("lt"); + writer.WriteNumberValue(LtValue.Value); + } + + if (LteValue.HasValue) + { + writer.WritePropertyName("lte"); + writer.WriteNumberValue(LteValue.Value); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (ToValue.HasValue) + { + writer.WritePropertyName("to"); + writer.WriteNumberValue(ToValue.Value); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class NumberRangeQueryDescriptor : SerializableDescriptor +{ + internal NumberRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + internal NumberRangeQueryDescriptor() : base() + { + } + + public NumberRangeQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private double? FromValue { get; set; } + private double? GtValue { get; set; } + private double? GteValue { get; set; } + private double? LtValue { get; set; } + private double? LteValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private double? ToValue { get; set; } + + public NumberRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public NumberRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public NumberRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public NumberRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumberRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumberRangeQueryDescriptor From(double? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public NumberRangeQueryDescriptor Gt(double? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public NumberRangeQueryDescriptor Gte(double? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public NumberRangeQueryDescriptor Lt(double? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public NumberRangeQueryDescriptor Lte(double? lte) + { + LteValue = lte; + return Self; + } + + public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public NumberRangeQueryDescriptor To(double? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.Value); + } + + if (GtValue.HasValue) + { + writer.WritePropertyName("gt"); + writer.WriteNumberValue(GtValue.Value); + } + + if (GteValue.HasValue) + { + writer.WritePropertyName("gte"); + writer.WriteNumberValue(GteValue.Value); + } + + if (LtValue.HasValue) + { + writer.WritePropertyName("lt"); + writer.WriteNumberValue(LtValue.Value); + } + + if (LteValue.HasValue) + { + writer.WritePropertyName("lte"); + writer.WriteNumberValue(LteValue.Value); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (ToValue.HasValue) + { + writer.WritePropertyName("to"); + writer.WriteNumberValue(ToValue.Value); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs new file mode 100644 index 00000000000..f12d935c9ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs @@ -0,0 +1,148 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ParentIdQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// ID of the parent document. + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. + /// + [JsonInclude, JsonPropertyName("ignore_unmapped")] + public bool? IgnoreUnmapped { get; set; } + + /// + /// Name of the child relationship mapped for the `join` field. + /// + [JsonInclude, JsonPropertyName("type")] + public string? Type { get; set; } + + public static implicit operator Query(ParentIdQuery parentIdQuery) => QueryDsl.Query.ParentId(parentIdQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("parent_id", this); +} + +public sealed partial class ParentIdQueryDescriptor : SerializableDescriptor +{ + internal ParentIdQueryDescriptor(Action configure) => configure.Invoke(this); + + public ParentIdQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private bool? IgnoreUnmappedValue { get; set; } + private string? TypeValue { get; set; } + + public ParentIdQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ParentIdQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// ID of the parent document. + /// + public ParentIdQueryDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. + /// + public ParentIdQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + { + IgnoreUnmappedValue = ignoreUnmapped; + return Self; + } + + /// + /// Name of the child relationship mapped for the `join` field. + /// + public ParentIdQueryDescriptor Type(string? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IgnoreUnmappedValue.HasValue) + { + writer.WritePropertyName("ignore_unmapped"); + writer.WriteBooleanValue(IgnoreUnmappedValue.Value); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs new file mode 100644 index 00000000000..b697af119c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs @@ -0,0 +1,485 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class PercolateQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The source of the document being percolated. + /// + [JsonInclude, JsonPropertyName("document")] + public object? Document { get; set; } + + /// + /// An array of sources of the documents being percolated. + /// + [JsonInclude, JsonPropertyName("documents")] + public ICollection? Documents { get; set; } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The ID of a stored document to percolate. + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// The index of a stored document to percolate. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified. + /// + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Preference used to fetch document to percolate. + /// + [JsonInclude, JsonPropertyName("preference")] + public string? Preference { get; set; } + + /// + /// Routing used to fetch document to percolate. + /// + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + + /// + /// The expected version of a stored document to percolate. + /// + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } + + public static implicit operator Query(PercolateQuery percolateQuery) => QueryDsl.Query.Percolate(percolateQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("percolate", this); +} + +public sealed partial class PercolateQueryDescriptor : SerializableDescriptor> +{ + internal PercolateQueryDescriptor(Action> configure) => configure.Invoke(this); + + public PercolateQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private object? DocumentValue { get; set; } + private ICollection? DocumentsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private string? NameValue { get; set; } + private string? PreferenceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private long? VersionValue { get; set; } + + public PercolateQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PercolateQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The source of the document being percolated. + /// + public PercolateQueryDescriptor Document(object? document) + { + DocumentValue = document; + return Self; + } + + /// + /// An array of sources of the documents being percolated. + /// + public PercolateQueryDescriptor Documents(ICollection? documents) + { + DocumentsValue = documents; + return Self; + } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + public PercolateQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + public PercolateQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The ID of a stored document to percolate. + /// + public PercolateQueryDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// The index of a stored document to percolate. + /// + public PercolateQueryDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified. + /// + public PercolateQueryDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// Preference used to fetch document to percolate. + /// + public PercolateQueryDescriptor Preference(string? preference) + { + PreferenceValue = preference; + return Self; + } + + /// + /// Routing used to fetch document to percolate. + /// + public PercolateQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// The expected version of a stored document to percolate. + /// + public PercolateQueryDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DocumentValue is not null) + { + writer.WritePropertyName("document"); + JsonSerializer.Serialize(writer, DocumentValue, options); + } + + if (DocumentsValue is not null) + { + writer.WritePropertyName("documents"); + JsonSerializer.Serialize(writer, DocumentsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (!string.IsNullOrEmpty(PreferenceValue)) + { + writer.WritePropertyName("preference"); + writer.WriteStringValue(PreferenceValue); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PercolateQueryDescriptor : SerializableDescriptor +{ + internal PercolateQueryDescriptor(Action configure) => configure.Invoke(this); + + public PercolateQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private object? DocumentValue { get; set; } + private ICollection? DocumentsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private string? NameValue { get; set; } + private string? PreferenceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + private long? VersionValue { get; set; } + + public PercolateQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PercolateQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The source of the document being percolated. + /// + public PercolateQueryDescriptor Document(object? document) + { + DocumentValue = document; + return Self; + } + + /// + /// An array of sources of the documents being percolated. + /// + public PercolateQueryDescriptor Documents(ICollection? documents) + { + DocumentsValue = documents; + return Self; + } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + public PercolateQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + public PercolateQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field that holds the indexed queries. The field must use the `percolator` mapping type. + /// + public PercolateQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The ID of a stored document to percolate. + /// + public PercolateQueryDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// The index of a stored document to percolate. + /// + public PercolateQueryDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified. + /// + public PercolateQueryDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// Preference used to fetch document to percolate. + /// + public PercolateQueryDescriptor Preference(string? preference) + { + PreferenceValue = preference; + return Self; + } + + /// + /// Routing used to fetch document to percolate. + /// + public PercolateQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// The expected version of a stored document to percolate. + /// + public PercolateQueryDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DocumentValue is not null) + { + writer.WritePropertyName("document"); + JsonSerializer.Serialize(writer, DocumentValue, options); + } + + if (DocumentsValue is not null) + { + writer.WritePropertyName("documents"); + JsonSerializer.Serialize(writer, DocumentsValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + } + + if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (!string.IsNullOrEmpty(PreferenceValue)) + { + writer.WritePropertyName("preference"); + writer.WriteStringValue(PreferenceValue); + } + + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (VersionValue is not null) + { + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedDoc.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedDoc.g.cs new file mode 100644 index 00000000000..d340fadd499 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedDoc.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class PinnedDoc +{ + /// + /// The unique document ID. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// The index that contains the document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } +} + +public sealed partial class PinnedDocDescriptor : SerializableDescriptor +{ + internal PinnedDocDescriptor(Action configure) => configure.Invoke(this); + + public PinnedDocDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + + /// + /// The unique document ID. + /// + public PinnedDocDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The index that contains the document. + /// + public PinnedDocDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("_id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("_index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs new file mode 100644 index 00000000000..4217048f047 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs @@ -0,0 +1,419 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(PinnedQueryConverter))] +public sealed partial class PinnedQuery : SearchQuery +{ + internal PinnedQuery(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static PinnedQuery Docs(ICollection variant) => new PinnedQuery("docs", variant); + public static PinnedQuery Ids(ICollection variant) => new PinnedQuery("ids", variant); + + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Any choice of query used to rank documents which will be ranked below the "pinned" documents. + /// + [JsonInclude, JsonPropertyName("organic")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Organic { get; set; } + + public static implicit operator Query(PinnedQuery pinnedQuery) => QueryDsl.Query.Pinned(pinnedQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("pinned", this); +} + +internal sealed partial class PinnedQueryConverter : JsonConverter +{ + public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + object? variantValue = default; + string? variantNameValue = default; + string? nameValue = default; + float? boostValue = default; + Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organicValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "_name") + { + nameValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "boost") + { + boostValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "organic") + { + organicValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "docs") + { + variantValue = JsonSerializer.Deserialize?>(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ids") + { + variantValue = JsonSerializer.Deserialize?>(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'PinnedQuery' from the response."); + } + + reader.Read(); + var result = new PinnedQuery(variantNameValue, variantValue); + result.QueryName = nameValue; + result.Boost = boostValue; + result.Organic = organicValue; + return result; + } + + public override void Write(Utf8JsonWriter writer, PinnedQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, value.Organic, options); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "docs": + JsonSerializer.Serialize>(writer, (ICollection)value.Variant, options); + break; + case "ids": + JsonSerializer.Serialize>(writer, (ICollection)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PinnedQueryDescriptor : SerializableDescriptor> +{ + internal PinnedQueryDescriptor(Action> configure) => configure.Invoke(this); + + public PinnedQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PinnedQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private PinnedQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } + private QueryDescriptor OrganicDescriptor { get; set; } + private Action> OrganicDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Any choice of query used to rank documents which will be ranked below the "pinned" documents. + /// + public PinnedQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organic) + { + OrganicDescriptor = null; + OrganicDescriptorAction = null; + OrganicValue = organic; + return Self; + } + + public PinnedQueryDescriptor Organic(QueryDescriptor descriptor) + { + OrganicValue = null; + OrganicDescriptorAction = null; + OrganicDescriptor = descriptor; + return Self; + } + + public PinnedQueryDescriptor Organic(Action> configure) + { + OrganicValue = null; + OrganicDescriptor = null; + OrganicDescriptorAction = configure; + return Self; + } + + public PinnedQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PinnedQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OrganicDescriptor is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicDescriptor, options); + } + else if (OrganicDescriptorAction is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + } + else + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PinnedQueryDescriptor : SerializableDescriptor +{ + internal PinnedQueryDescriptor(Action configure) => configure.Invoke(this); + + public PinnedQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PinnedQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private PinnedQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } + private QueryDescriptor OrganicDescriptor { get; set; } + private Action OrganicDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Any choice of query used to rank documents which will be ranked below the "pinned" documents. + /// + public PinnedQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organic) + { + OrganicDescriptor = null; + OrganicDescriptorAction = null; + OrganicValue = organic; + return Self; + } + + public PinnedQueryDescriptor Organic(QueryDescriptor descriptor) + { + OrganicValue = null; + OrganicDescriptorAction = null; + OrganicDescriptor = descriptor; + return Self; + } + + public PinnedQueryDescriptor Organic(Action configure) + { + OrganicValue = null; + OrganicDescriptor = null; + OrganicDescriptorAction = configure; + return Self; + } + + public PinnedQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PinnedQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OrganicDescriptor is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicDescriptor, options); + } + else if (OrganicDescriptorAction is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + } + else + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs new file mode 100644 index 00000000000..21bd7720738 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs @@ -0,0 +1,392 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class PrefixQueryConverter : JsonConverter +{ + public override PrefixQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new PrefixQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "case_insensitive") + { + variant.CaseInsensitive = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rewrite") + { + variant.Rewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, PrefixQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize PrefixQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } + + if (value.Rewrite is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, value.Rewrite, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(PrefixQueryConverter))] +public sealed partial class PrefixQuery : SearchQuery +{ + public PrefixQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
Default is `false` which means the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public bool? CaseInsensitive { get; set; } + + /// + /// Method used to rewrite the query. + /// + public string? Rewrite { get; set; } + + /// + /// Beginning characters of terms you wish to find in the provided field. + /// + public string Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(PrefixQuery prefixQuery) => QueryDsl.Query.Prefix(prefixQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("prefix", this); +} + +public sealed partial class PrefixQueryDescriptor : SerializableDescriptor> +{ + internal PrefixQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal PrefixQueryDescriptor() : base() + { + } + + public PrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public PrefixQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? RewriteValue { get; set; } + private string ValueValue { get; set; } + + public PrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
Default is `false` which means the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public PrefixQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public PrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public PrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public PrefixQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Beginning characters of terms you wish to find in the provided field. + /// + public PrefixQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class PrefixQueryDescriptor : SerializableDescriptor +{ + internal PrefixQueryDescriptor(Action configure) => configure.Invoke(this); + + internal PrefixQueryDescriptor() : base() + { + } + + public PrefixQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? RewriteValue { get; set; } + private string ValueValue { get; set; } + + public PrefixQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public PrefixQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
Default is `false` which means the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public PrefixQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public PrefixQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public PrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public PrefixQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public PrefixQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Beginning characters of terms you wish to find in the provided field. + /// + public PrefixQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs new file mode 100644 index 00000000000..fd4a712d57f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs @@ -0,0 +1,1038 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(QueryConverter))] +public sealed partial class Query +{ + internal Query(string variantName, SearchQuery variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; private set; } + internal string VariantName { get; private set; } + + internal void WrapVariant(string variantName, SearchQuery variant) + { + VariantName = variantName; + Variant = variant; + } + + public static Query Bool(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoolQuery boolQuery) => new Query("bool", boolQuery); + public static Query Boosting(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoostingQuery boostingQuery) => new Query("boosting", boostingQuery); + public static Query CombinedFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => new Query("combined_fields", combinedFieldsQuery); + public static Query ConstantScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ConstantScoreQuery constantScoreQuery) => new Query("constant_score", constantScoreQuery); + public static Query DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => new Query("dis_max", disMaxQuery); + public static Query Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => new Query("exists", existsQuery); + public static Query FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => new Query("field_masking_span", spanFieldMaskingQuery); + public static Query FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => new Query("function_score", functionScoreQuery); + public static Query Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FuzzyQuery fuzzyQuery) => new Query("fuzzy", fuzzyQuery); + public static Query GeoBoundingBox(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => new Query("geo_bounding_box", geoBoundingBoxQuery); + public static Query GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => new Query("geo_distance", geoDistanceQuery); + public static Query GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => new Query("geo_polygon", geoPolygonQuery); + public static Query HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => new Query("has_child", hasChildQuery); + public static Query HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => new Query("has_parent", hasParentQuery); + public static Query Ids(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IdsQuery idsQuery) => new Query("ids", idsQuery); + public static Query Intervals(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery intervalsQuery) => new Query("intervals", intervalsQuery); + public static Query Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchQuery matchQuery) => new Query("match", matchQuery); + public static Query MatchAll(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchAllQuery matchAllQuery) => new Query("match_all", matchAllQuery); + public static Query MatchBoolPrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchBoolPrefixQuery matchBoolPrefixQuery) => new Query("match_bool_prefix", matchBoolPrefixQuery); + public static Query MatchNone(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchNoneQuery matchNoneQuery) => new Query("match_none", matchNoneQuery); + public static Query MatchPhrase(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhraseQuery matchPhraseQuery) => new Query("match_phrase", matchPhraseQuery); + public static Query MatchPhrasePrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhrasePrefixQuery matchPhrasePrefixQuery) => new Query("match_phrase_prefix", matchPhrasePrefixQuery); + public static Query MoreLikeThis(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MoreLikeThisQuery moreLikeThisQuery) => new Query("more_like_this", moreLikeThisQuery); + public static Query MultiMatch(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiMatchQuery multiMatchQuery) => new Query("multi_match", multiMatchQuery); + public static Query Nested(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NestedQuery nestedQuery) => new Query("nested", nestedQuery); + public static Query ParentId(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ParentIdQuery parentIdQuery) => new Query("parent_id", parentIdQuery); + public static Query Percolate(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PercolateQuery percolateQuery) => new Query("percolate", percolateQuery); + public static Query Pinned(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedQuery pinnedQuery) => new Query("pinned", pinnedQuery); + public static Query Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PrefixQuery prefixQuery) => new Query("prefix", prefixQuery); + public static Query QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => new Query("query_string", queryStringQuery); + public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery rankFeatureQuery) => new Query("rank_feature", rankFeatureQuery); + public static Query RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => new Query("raw_json", rawJsonQuery); + public static Query Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => new Query("regexp", regexpQuery); + public static Query RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => new Query("rule_query", ruleQuery); + public static Query Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => new Query("script", scriptQuery); + public static Query ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => new Query("script_score", scriptScoreQuery); + public static Query SimpleQueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => new Query("simple_query_string", simpleQueryStringQuery); + public static Query SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => new Query("span_containing", spanContainingQuery); + public static Query SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => new Query("span_first", spanFirstQuery); + public static Query SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => new Query("span_multi", spanMultiTermQuery); + public static Query SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => new Query("span_near", spanNearQuery); + public static Query SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => new Query("span_not", spanNotQuery); + public static Query SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => new Query("span_or", spanOrQuery); + public static Query SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => new Query("span_term", spanTermQuery); + public static Query SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => new Query("span_within", spanWithinQuery); + public static Query Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => new Query("term", termQuery); + public static Query Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => new Query("terms", termsQuery); + public static Query TermsSet(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsSetQuery termsSetQuery) => new Query("terms_set", termsSetQuery); + public static Query TextExpansion(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextExpansionQuery textExpansionQuery) => new Query("text_expansion", textExpansionQuery); + public static Query Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WildcardQuery wildcardQuery) => new Query("wildcard", wildcardQuery); + public static Query Wrapper(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WrapperQuery wrapperQuery) => new Query("wrapper", wrapperQuery); +} + +internal sealed partial class QueryConverter : JsonConverter +{ + public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "bool") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "boosting") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "combined_fields") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "constant_score") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "dis_max") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "exists") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "field_masking_span") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "function_score") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "fuzzy") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "geo_bounding_box") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "geo_distance") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "geo_polygon") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "has_child") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "has_parent") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "ids") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "intervals") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match_all") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match_bool_prefix") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match_none") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match_phrase") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "match_phrase_prefix") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "more_like_this") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "multi_match") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "nested") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "parent_id") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "percolate") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "pinned") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "prefix") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "query_string") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "range") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "rank_feature") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "raw_json") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "regexp") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "rule_query") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "script") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "script_score") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "simple_query_string") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_containing") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_first") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_multi") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_near") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_not") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_or") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_term") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "span_within") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "term") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "terms") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "terms_set") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "text_expansion") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "wildcard") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + if (propertyName == "wrapper") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Query(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOptions options) + { + if (value.VariantName == "raw_json" && value.TryGet(out var rawJsonQuery)) + { + writer.WriteRawValue(rawJsonQuery.Raw); + return; + } + + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "bool": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoolQuery)value.Variant, options); + break; + case "boosting": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoostingQuery)value.Variant, options); + break; + case "combined_fields": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsQuery)value.Variant, options); + break; + case "constant_score": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ConstantScoreQuery)value.Variant, options); + break; + case "dis_max": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery)value.Variant, options); + break; + case "exists": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery)value.Variant, options); + break; + case "field_masking_span": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery)value.Variant, options); + break; + case "function_score": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery)value.Variant, options); + break; + case "fuzzy": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FuzzyQuery)value.Variant, options); + break; + case "geo_bounding_box": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoBoundingBoxQuery)value.Variant, options); + break; + case "geo_distance": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery)value.Variant, options); + break; + case "geo_polygon": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery)value.Variant, options); + break; + case "has_child": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery)value.Variant, options); + break; + case "has_parent": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery)value.Variant, options); + break; + case "ids": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IdsQuery)value.Variant, options); + break; + case "intervals": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery)value.Variant, options); + break; + case "match": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchQuery)value.Variant, options); + break; + case "match_all": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchAllQuery)value.Variant, options); + break; + case "match_bool_prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchBoolPrefixQuery)value.Variant, options); + break; + case "match_none": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchNoneQuery)value.Variant, options); + break; + case "match_phrase": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhraseQuery)value.Variant, options); + break; + case "match_phrase_prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhrasePrefixQuery)value.Variant, options); + break; + case "more_like_this": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MoreLikeThisQuery)value.Variant, options); + break; + case "multi_match": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiMatchQuery)value.Variant, options); + break; + case "nested": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NestedQuery)value.Variant, options); + break; + case "parent_id": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ParentIdQuery)value.Variant, options); + break; + case "percolate": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PercolateQuery)value.Variant, options); + break; + case "pinned": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedQuery)value.Variant, options); + break; + case "prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PrefixQuery)value.Variant, options); + break; + case "query_string": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery)value.Variant, options); + break; + case "range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery)value.Variant, options); + break; + case "rank_feature": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery)value.Variant, options); + break; + case "raw_json": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery)value.Variant, options); + break; + case "regexp": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery)value.Variant, options); + break; + case "rule_query": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery)value.Variant, options); + break; + case "script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery)value.Variant, options); + break; + case "script_score": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery)value.Variant, options); + break; + case "simple_query_string": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringQuery)value.Variant, options); + break; + case "span_containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery)value.Variant, options); + break; + case "span_first": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery)value.Variant, options); + break; + case "span_multi": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery)value.Variant, options); + break; + case "span_near": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery)value.Variant, options); + break; + case "span_not": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery)value.Variant, options); + break; + case "span_or": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery)value.Variant, options); + break; + case "span_term": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery)value.Variant, options); + break; + case "span_within": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery)value.Variant, options); + break; + case "term": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery)value.Variant, options); + break; + case "terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery)value.Variant, options); + break; + case "terms_set": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsSetQuery)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextExpansionQuery)value.Variant, options); + break; + case "wildcard": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WildcardQuery)value.Variant, options); + break; + case "wrapper": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WrapperQuery)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class QueryDescriptor : SerializableDescriptor> +{ + internal QueryDescriptor(Action> configure) => configure.Invoke(this); + + public QueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private QueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private QueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public QueryDescriptor Bool(BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action> configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action> configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action> configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action> configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action> configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action> configure) => Set(configure, "intervals"); + public QueryDescriptor Match(MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action> configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action> configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action> configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action> configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action> configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action> configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action> configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action> configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action> configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); + public QueryDescriptor Range(RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Action> configure) => Set(configure, "range"); + public QueryDescriptor RankFeature(RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); + public QueryDescriptor RankFeature(Action> configure) => Set(configure, "rank_feature"); + public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); + public QueryDescriptor Regexp(RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action> configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action> configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + public QueryDescriptor Term(TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action> configure) => Set(configure, "term"); + public QueryDescriptor Terms(TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action> configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action> configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action> configure) => Set(configure, "text_expansion"); + public QueryDescriptor Wildcard(WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(WrapperQuery wrapperQuery) => Set(wrapperQuery, "wrapper"); + public QueryDescriptor Wrapper(Action configure) => Set(configure, "wrapper"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + if (ContainedVariantName == "raw_json") + { + writer.WriteRawValue(((RawJsonQuery)Variant).Raw); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class QueryDescriptor : SerializableDescriptor +{ + internal QueryDescriptor(Action configure) => configure.Invoke(this); + + public QueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private QueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private QueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public QueryDescriptor Bool(BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action configure) => Set(configure, "bool"); + public QueryDescriptor Bool(Action> configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action configure) => Set(configure, "boosting"); + public QueryDescriptor Boosting(Action> configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action configure) => Set(configure, "combined_fields"); + public QueryDescriptor CombinedFields(Action> configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action configure) => Set(configure, "constant_score"); + public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action configure) => Set(configure, "dis_max"); + public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action configure) => Set(configure, "exists"); + public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action configure) => Set(configure, "function_score"); + public QueryDescriptor FunctionScore(Action> configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public QueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action configure) => Set(configure, "has_child"); + public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action configure) => Set(configure, "has_parent"); + public QueryDescriptor HasParent(Action> configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action configure) => Set(configure, "intervals"); + public QueryDescriptor Intervals(Action> configure) => Set(configure, "intervals"); + public QueryDescriptor Match(MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action configure) => Set(configure, "match"); + public QueryDescriptor Match(Action> configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action> configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrase(Action> configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action> configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action configure) => Set(configure, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action> configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action configure) => Set(configure, "multi_match"); + public QueryDescriptor MultiMatch(Action> configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action configure) => Set(configure, "nested"); + public QueryDescriptor Nested(Action> configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action configure) => Set(configure, "percolate"); + public QueryDescriptor Percolate(Action> configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action configure) => Set(configure, "pinned"); + public QueryDescriptor Pinned(Action> configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action configure) => Set(configure, "query_string"); + public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); + public QueryDescriptor Range(RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Action configure) => Set(configure, "range"); + public QueryDescriptor Range(Action> configure) => Set(configure, "range"); + public QueryDescriptor RankFeature(RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); + public QueryDescriptor RankFeature(Action configure) => Set(configure, "rank_feature"); + public QueryDescriptor RankFeature(Action> configure) => Set(configure, "rank_feature"); + public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); + public QueryDescriptor Regexp(RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action configure) => Set(configure, "regexp"); + public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action configure) => Set(configure, "rule_query"); + public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action configure) => Set(configure, "script_score"); + public QueryDescriptor ScriptScore(Action> configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action> configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public QueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public QueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public QueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public QueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action configure) => Set(configure, "span_within"); + public QueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + public QueryDescriptor Term(TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action configure) => Set(configure, "term"); + public QueryDescriptor Term(Action> configure) => Set(configure, "term"); + public QueryDescriptor Terms(TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action configure) => Set(configure, "terms"); + public QueryDescriptor Terms(Action> configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action configure) => Set(configure, "terms_set"); + public QueryDescriptor TermsSet(Action> configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public QueryDescriptor TextExpansion(Action> configure) => Set(configure, "text_expansion"); + public QueryDescriptor Wildcard(WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action configure) => Set(configure, "wildcard"); + public QueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(WrapperQuery wrapperQuery) => Set(wrapperQuery, "wrapper"); + public QueryDescriptor Wrapper(Action configure) => Set(configure, "wrapper"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + if (ContainedVariantName == "raw_json") + { + writer.WriteRawValue(((RawJsonQuery)Variant).Raw); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs new file mode 100644 index 00000000000..0b38f66f05a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs @@ -0,0 +1,1083 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class QueryStringQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string. + /// + [JsonInclude, JsonPropertyName("allow_leading_wildcard")] + public bool? AllowLeadingWildcard { get; set; } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + [JsonInclude, JsonPropertyName("analyze_wildcard")] + public bool? AnalyzeWildcard { get; set; } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + [JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] + public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ [JsonInclude, JsonPropertyName("default_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? DefaultField { get; set; } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + [JsonInclude, JsonPropertyName("default_operator")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get; set; } + + /// + /// If `true`, enable position increments in queries constructed from a `query_string` search. + /// + [JsonInclude, JsonPropertyName("enable_position_increments")] + public bool? EnablePositionIncrements { get; set; } + [JsonInclude, JsonPropertyName("escape")] + public bool? Escape { get; set; } + + /// + /// Array of fields to search. Supports wildcards (`*`). + /// + [JsonInclude, JsonPropertyName("fields")] + public Fields? Fields { get; set; } + + /// + /// Maximum edit distance allowed for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("fuzziness")] + public Elastic.Clients.Elasticsearch.Serverless.Fuzziness? Fuzziness { get; set; } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("fuzzy_max_expansions")] + public int? FuzzyMaxExpansions { get; set; } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("fuzzy_prefix_length")] + public int? FuzzyPrefixLength { get; set; } + + /// + /// Method used to rewrite the query. + /// + [JsonInclude, JsonPropertyName("fuzzy_rewrite")] + public string? FuzzyRewrite { get; set; } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + [JsonInclude, JsonPropertyName("fuzzy_transpositions")] + public bool? FuzzyTranspositions { get; set; } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + [JsonInclude, JsonPropertyName("lenient")] + public bool? Lenient { get; set; } + + /// + /// Maximum number of automaton states required for the query. + /// + [JsonInclude, JsonPropertyName("max_determinized_states")] + public int? MaxDeterminizedStates { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Maximum number of positions allowed between matching tokens for phrases. + /// + [JsonInclude, JsonPropertyName("phrase_slop")] + public double? PhraseSlop { get; set; } + + /// + /// Query string you wish to parse and use for search. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// Analyzer used to convert quoted text in the query string into tokens.
For quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter.
+ ///
+ [JsonInclude, JsonPropertyName("quote_analyzer")] + public string? QuoteAnalyzer { get; set; } + + /// + /// Suffix appended to quoted text in the query string.
You can use this suffix to use a different analysis method for exact matches.
+ ///
+ [JsonInclude, JsonPropertyName("quote_field_suffix")] + public string? QuoteFieldSuffix { get; set; } + + /// + /// Method used to rewrite the query. + /// + [JsonInclude, JsonPropertyName("rewrite")] + public string? Rewrite { get; set; } + + /// + /// How to combine the queries generated from the individual search terms in the resulting `dis_max` query. + /// + [JsonInclude, JsonPropertyName("tie_breaker")] + public double? TieBreaker { get; set; } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC. + /// + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + + /// + /// Determines how the query matches and scores documents. + /// + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? Type { get; set; } + + public static implicit operator Query(QueryStringQuery queryStringQuery) => QueryDsl.Query.QueryString(queryStringQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("query_string", this); +} + +public sealed partial class QueryStringQueryDescriptor : SerializableDescriptor> +{ + internal QueryStringQueryDescriptor(Action> configure) => configure.Invoke(this); + + public QueryStringQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AllowLeadingWildcardValue { get; set; } + private bool? AnalyzeWildcardValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DefaultFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperatorValue { get; set; } + private bool? EnablePositionIncrementsValue { get; set; } + private bool? EscapeValue { get; set; } + private Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? FuzzyMaxExpansionsValue { get; set; } + private int? FuzzyPrefixLengthValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxDeterminizedStatesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private double? PhraseSlopValue { get; set; } + private string QueryValue { get; set; } + private string? QuoteAnalyzerValue { get; set; } + private string? QuoteFieldSuffixValue { get; set; } + private string? RewriteValue { get; set; } + private double? TieBreakerValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? TypeValue { get; set; } + + public QueryStringQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string. + /// + public QueryStringQueryDescriptor AllowLeadingWildcard(bool? allowLeadingWildcard = true) + { + AllowLeadingWildcardValue = allowLeadingWildcard; + return Self; + } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + public QueryStringQueryDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) + { + AnalyzeWildcardValue = analyzeWildcard; + return Self; + } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + public QueryStringQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public QueryStringQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public QueryStringQueryDescriptor DefaultField(Elastic.Clients.Elasticsearch.Serverless.Field? defaultField) + { + DefaultFieldValue = defaultField; + return Self; + } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public QueryStringQueryDescriptor DefaultField(Expression> defaultField) + { + DefaultFieldValue = defaultField; + return Self; + } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + public QueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) + { + DefaultOperatorValue = defaultOperator; + return Self; + } + + /// + /// If `true`, enable position increments in queries constructed from a `query_string` search. + /// + public QueryStringQueryDescriptor EnablePositionIncrements(bool? enablePositionIncrements = true) + { + EnablePositionIncrementsValue = enablePositionIncrements; + return Self; + } + + public QueryStringQueryDescriptor Escape(bool? escape = true) + { + EscapeValue = escape; + return Self; + } + + /// + /// Array of fields to search. Supports wildcards (`*`). + /// + public QueryStringQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Maximum edit distance allowed for fuzzy matching. + /// + public QueryStringQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + public QueryStringQueryDescriptor FuzzyMaxExpansions(int? fuzzyMaxExpansions) + { + FuzzyMaxExpansionsValue = fuzzyMaxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public QueryStringQueryDescriptor FuzzyPrefixLength(int? fuzzyPrefixLength) + { + FuzzyPrefixLengthValue = fuzzyPrefixLength; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public QueryStringQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public QueryStringQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + public QueryStringQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of automaton states required for the query. + /// + public QueryStringQueryDescriptor MaxDeterminizedStates(int? maxDeterminizedStates) + { + MaxDeterminizedStatesValue = maxDeterminizedStates; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public QueryStringQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens for phrases. + /// + public QueryStringQueryDescriptor PhraseSlop(double? phraseSlop) + { + PhraseSlopValue = phraseSlop; + return Self; + } + + /// + /// Query string you wish to parse and use for search. + /// + public QueryStringQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Analyzer used to convert quoted text in the query string into tokens.
For quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter.
+ ///
+ public QueryStringQueryDescriptor QuoteAnalyzer(string? quoteAnalyzer) + { + QuoteAnalyzerValue = quoteAnalyzer; + return Self; + } + + /// + /// Suffix appended to quoted text in the query string.
You can use this suffix to use a different analysis method for exact matches.
+ ///
+ public QueryStringQueryDescriptor QuoteFieldSuffix(string? quoteFieldSuffix) + { + QuoteFieldSuffixValue = quoteFieldSuffix; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public QueryStringQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// How to combine the queries generated from the individual search terms in the resulting `dis_max` query. + /// + public QueryStringQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC. + /// + public QueryStringQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + /// + /// Determines how the query matches and scores documents. + /// + public QueryStringQueryDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AllowLeadingWildcardValue.HasValue) + { + writer.WritePropertyName("allow_leading_wildcard"); + writer.WriteBooleanValue(AllowLeadingWildcardValue.Value); + } + + if (AnalyzeWildcardValue.HasValue) + { + writer.WritePropertyName("analyze_wildcard"); + writer.WriteBooleanValue(AnalyzeWildcardValue.Value); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DefaultFieldValue is not null) + { + writer.WritePropertyName("default_field"); + JsonSerializer.Serialize(writer, DefaultFieldValue, options); + } + + if (DefaultOperatorValue is not null) + { + writer.WritePropertyName("default_operator"); + JsonSerializer.Serialize(writer, DefaultOperatorValue, options); + } + + if (EnablePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("enable_position_increments"); + writer.WriteBooleanValue(EnablePositionIncrementsValue.Value); + } + + if (EscapeValue.HasValue) + { + writer.WritePropertyName("escape"); + writer.WriteBooleanValue(EscapeValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyMaxExpansionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_max_expansions"); + writer.WriteNumberValue(FuzzyMaxExpansionsValue.Value); + } + + if (FuzzyPrefixLengthValue.HasValue) + { + writer.WritePropertyName("fuzzy_prefix_length"); + writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxDeterminizedStatesValue.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(MaxDeterminizedStatesValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (PhraseSlopValue.HasValue) + { + writer.WritePropertyName("phrase_slop"); + writer.WriteNumberValue(PhraseSlopValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(QuoteAnalyzerValue)) + { + writer.WritePropertyName("quote_analyzer"); + writer.WriteStringValue(QuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(QuoteFieldSuffixValue)) + { + writer.WritePropertyName("quote_field_suffix"); + writer.WriteStringValue(QuoteFieldSuffixValue); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class QueryStringQueryDescriptor : SerializableDescriptor +{ + internal QueryStringQueryDescriptor(Action configure) => configure.Invoke(this); + + public QueryStringQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AllowLeadingWildcardValue { get; set; } + private bool? AnalyzeWildcardValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DefaultFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperatorValue { get; set; } + private bool? EnablePositionIncrementsValue { get; set; } + private bool? EscapeValue { get; set; } + private Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } + private int? FuzzyMaxExpansionsValue { get; set; } + private int? FuzzyPrefixLengthValue { get; set; } + private string? FuzzyRewriteValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private int? MaxDeterminizedStatesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private double? PhraseSlopValue { get; set; } + private string QueryValue { get; set; } + private string? QuoteAnalyzerValue { get; set; } + private string? QuoteFieldSuffixValue { get; set; } + private string? RewriteValue { get; set; } + private double? TieBreakerValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? TypeValue { get; set; } + + public QueryStringQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string. + /// + public QueryStringQueryDescriptor AllowLeadingWildcard(bool? allowLeadingWildcard = true) + { + AllowLeadingWildcardValue = allowLeadingWildcard; + return Self; + } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + public QueryStringQueryDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) + { + AnalyzeWildcardValue = analyzeWildcard; + return Self; + } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + public QueryStringQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, match phrase queries are automatically created for multi-term synonyms. + /// + public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public QueryStringQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public QueryStringQueryDescriptor DefaultField(Elastic.Clients.Elasticsearch.Serverless.Field? defaultField) + { + DefaultFieldValue = defaultField; + return Self; + } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public QueryStringQueryDescriptor DefaultField(Expression> defaultField) + { + DefaultFieldValue = defaultField; + return Self; + } + + /// + /// Default field to search if no field is provided in the query string.
Supports wildcards (`*`).
Defaults to the `index.query.default_field` index setting, which has a default value of `*`.
+ ///
+ public QueryStringQueryDescriptor DefaultField(Expression> defaultField) + { + DefaultFieldValue = defaultField; + return Self; + } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + public QueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) + { + DefaultOperatorValue = defaultOperator; + return Self; + } + + /// + /// If `true`, enable position increments in queries constructed from a `query_string` search. + /// + public QueryStringQueryDescriptor EnablePositionIncrements(bool? enablePositionIncrements = true) + { + EnablePositionIncrementsValue = enablePositionIncrements; + return Self; + } + + public QueryStringQueryDescriptor Escape(bool? escape = true) + { + EscapeValue = escape; + return Self; + } + + /// + /// Array of fields to search. Supports wildcards (`*`). + /// + public QueryStringQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Maximum edit distance allowed for fuzzy matching. + /// + public QueryStringQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Serverless.Fuzziness? fuzziness) + { + FuzzinessValue = fuzziness; + return Self; + } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + public QueryStringQueryDescriptor FuzzyMaxExpansions(int? fuzzyMaxExpansions) + { + FuzzyMaxExpansionsValue = fuzzyMaxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public QueryStringQueryDescriptor FuzzyPrefixLength(int? fuzzyPrefixLength) + { + FuzzyPrefixLengthValue = fuzzyPrefixLength; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public QueryStringQueryDescriptor FuzzyRewrite(string? fuzzyRewrite) + { + FuzzyRewriteValue = fuzzyRewrite; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public QueryStringQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + public QueryStringQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Maximum number of automaton states required for the query. + /// + public QueryStringQueryDescriptor MaxDeterminizedStates(int? maxDeterminizedStates) + { + MaxDeterminizedStatesValue = maxDeterminizedStates; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public QueryStringQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Maximum number of positions allowed between matching tokens for phrases. + /// + public QueryStringQueryDescriptor PhraseSlop(double? phraseSlop) + { + PhraseSlopValue = phraseSlop; + return Self; + } + + /// + /// Query string you wish to parse and use for search. + /// + public QueryStringQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Analyzer used to convert quoted text in the query string into tokens.
For quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter.
+ ///
+ public QueryStringQueryDescriptor QuoteAnalyzer(string? quoteAnalyzer) + { + QuoteAnalyzerValue = quoteAnalyzer; + return Self; + } + + /// + /// Suffix appended to quoted text in the query string.
You can use this suffix to use a different analysis method for exact matches.
+ ///
+ public QueryStringQueryDescriptor QuoteFieldSuffix(string? quoteFieldSuffix) + { + QuoteFieldSuffixValue = quoteFieldSuffix; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public QueryStringQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// How to combine the queries generated from the individual search terms in the resulting `dis_max` query. + /// + public QueryStringQueryDescriptor TieBreaker(double? tieBreaker) + { + TieBreakerValue = tieBreaker; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC. + /// + public QueryStringQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + /// + /// Determines how the query matches and scores documents. + /// + public QueryStringQueryDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextQueryType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AllowLeadingWildcardValue.HasValue) + { + writer.WritePropertyName("allow_leading_wildcard"); + writer.WriteBooleanValue(AllowLeadingWildcardValue.Value); + } + + if (AnalyzeWildcardValue.HasValue) + { + writer.WritePropertyName("analyze_wildcard"); + writer.WriteBooleanValue(AnalyzeWildcardValue.Value); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DefaultFieldValue is not null) + { + writer.WritePropertyName("default_field"); + JsonSerializer.Serialize(writer, DefaultFieldValue, options); + } + + if (DefaultOperatorValue is not null) + { + writer.WritePropertyName("default_operator"); + JsonSerializer.Serialize(writer, DefaultOperatorValue, options); + } + + if (EnablePositionIncrementsValue.HasValue) + { + writer.WritePropertyName("enable_position_increments"); + writer.WriteBooleanValue(EnablePositionIncrementsValue.Value); + } + + if (EscapeValue.HasValue) + { + writer.WritePropertyName("escape"); + writer.WriteBooleanValue(EscapeValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FuzzinessValue is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, FuzzinessValue, options); + } + + if (FuzzyMaxExpansionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_max_expansions"); + writer.WriteNumberValue(FuzzyMaxExpansionsValue.Value); + } + + if (FuzzyPrefixLengthValue.HasValue) + { + writer.WritePropertyName("fuzzy_prefix_length"); + writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); + } + + if (FuzzyRewriteValue is not null) + { + writer.WritePropertyName("fuzzy_rewrite"); + JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MaxDeterminizedStatesValue.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(MaxDeterminizedStatesValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + if (PhraseSlopValue.HasValue) + { + writer.WritePropertyName("phrase_slop"); + writer.WriteNumberValue(PhraseSlopValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(QuoteAnalyzerValue)) + { + writer.WritePropertyName("quote_analyzer"); + writer.WriteStringValue(QuoteAnalyzerValue); + } + + if (!string.IsNullOrEmpty(QuoteFieldSuffixValue)) + { + writer.WritePropertyName("quote_field_suffix"); + writer.WriteStringValue(QuoteFieldSuffixValue); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (TieBreakerValue.HasValue) + { + writer.WritePropertyName("tie_breaker"); + writer.WriteNumberValue(TieBreakerValue.Value); + } + + if (TimeZoneValue is not null) + { + writer.WritePropertyName("time_zone"); + JsonSerializer.Serialize(writer, TimeZoneValue, options); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs new file mode 100644 index 00000000000..37f70a91a57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs @@ -0,0 +1,140 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RandomScoreFunction +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("seed")] + public Union? Seed { get; set; } + + public static implicit operator FunctionScore(RandomScoreFunction randomScoreFunction) => QueryDsl.FunctionScore.RandomScore(randomScoreFunction); +} + +public sealed partial class RandomScoreFunctionDescriptor : SerializableDescriptor> +{ + internal RandomScoreFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public RandomScoreFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Union? SeedValue { get; set; } + + public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Seed(Union? seed) + { + SeedValue = seed; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (SeedValue is not null) + { + writer.WritePropertyName("seed"); + JsonSerializer.Serialize(writer, SeedValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RandomScoreFunctionDescriptor : SerializableDescriptor +{ + internal RandomScoreFunctionDescriptor(Action configure) => configure.Invoke(this); + + public RandomScoreFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Union? SeedValue { get; set; } + + public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Seed(Union? seed) + { + SeedValue = seed; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (SeedValue is not null) + { + writer.WritePropertyName("seed"); + JsonSerializer.Serialize(writer, SeedValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs new file mode 100644 index 00000000000..0c14cdc2ef0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RankFeatureFunctionLinear +{ +} + +public sealed partial class RankFeatureFunctionLinearDescriptor : SerializableDescriptor +{ + internal RankFeatureFunctionLinearDescriptor(Action configure) => configure.Invoke(this); + + public RankFeatureFunctionLinearDescriptor() : base() + { + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs new file mode 100644 index 00000000000..4312116848e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs @@ -0,0 +1,65 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RankFeatureFunctionLogarithm +{ + /// + /// Configurable scaling factor. + /// + [JsonInclude, JsonPropertyName("scaling_factor")] + public float ScalingFactor { get; set; } +} + +public sealed partial class RankFeatureFunctionLogarithmDescriptor : SerializableDescriptor +{ + internal RankFeatureFunctionLogarithmDescriptor(Action configure) => configure.Invoke(this); + + public RankFeatureFunctionLogarithmDescriptor() : base() + { + } + + private float ScalingFactorValue { get; set; } + + /// + /// Configurable scaling factor. + /// + public RankFeatureFunctionLogarithmDescriptor ScalingFactor(float scalingFactor) + { + ScalingFactorValue = scalingFactor; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("scaling_factor"); + writer.WriteNumberValue(ScalingFactorValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs new file mode 100644 index 00000000000..d83f8f87c94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RankFeatureFunctionSaturation +{ + /// + /// Configurable pivot value so that the result will be less than 0.5. + /// + [JsonInclude, JsonPropertyName("pivot")] + public float? Pivot { get; set; } +} + +public sealed partial class RankFeatureFunctionSaturationDescriptor : SerializableDescriptor +{ + internal RankFeatureFunctionSaturationDescriptor(Action configure) => configure.Invoke(this); + + public RankFeatureFunctionSaturationDescriptor() : base() + { + } + + private float? PivotValue { get; set; } + + /// + /// Configurable pivot value so that the result will be less than 0.5. + /// + public RankFeatureFunctionSaturationDescriptor Pivot(float? pivot) + { + PivotValue = pivot; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PivotValue.HasValue) + { + writer.WritePropertyName("pivot"); + writer.WriteNumberValue(PivotValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs new file mode 100644 index 00000000000..d38dea209fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RankFeatureFunctionSigmoid +{ + /// + /// Configurable Exponent. + /// + [JsonInclude, JsonPropertyName("exponent")] + public float Exponent { get; set; } + + /// + /// Configurable pivot value so that the result will be less than 0.5. + /// + [JsonInclude, JsonPropertyName("pivot")] + public float Pivot { get; set; } +} + +public sealed partial class RankFeatureFunctionSigmoidDescriptor : SerializableDescriptor +{ + internal RankFeatureFunctionSigmoidDescriptor(Action configure) => configure.Invoke(this); + + public RankFeatureFunctionSigmoidDescriptor() : base() + { + } + + private float ExponentValue { get; set; } + private float PivotValue { get; set; } + + /// + /// Configurable Exponent. + /// + public RankFeatureFunctionSigmoidDescriptor Exponent(float exponent) + { + ExponentValue = exponent; + return Self; + } + + /// + /// Configurable pivot value so that the result will be less than 0.5. + /// + public RankFeatureFunctionSigmoidDescriptor Pivot(float pivot) + { + PivotValue = pivot; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("exponent"); + writer.WriteNumberValue(ExponentValue); + writer.WritePropertyName("pivot"); + writer.WriteNumberValue(PivotValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs new file mode 100644 index 00000000000..100d3dfc2b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs @@ -0,0 +1,573 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RankFeatureQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Linear function used to boost relevance scores based on the value of the rank feature `field`. + /// + [JsonInclude, JsonPropertyName("linear")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinear? Linear { get; set; } + + /// + /// Logarithmic function used to boost relevance scores based on the value of the rank feature `field`. + /// + [JsonInclude, JsonPropertyName("log")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? Log { get; set; } + + /// + /// Saturation function used to boost relevance scores based on the value of the rank feature `field`. + /// + [JsonInclude, JsonPropertyName("saturation")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturation? Saturation { get; set; } + + /// + /// Sigmoid function used to boost relevance scores based on the value of the rank feature `field`. + /// + [JsonInclude, JsonPropertyName("sigmoid")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoid? Sigmoid { get; set; } + + public static implicit operator Query(RankFeatureQuery rankFeatureQuery) => QueryDsl.Query.RankFeature(rankFeatureQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("rank_feature", this); +} + +public sealed partial class RankFeatureQueryDescriptor : SerializableDescriptor> +{ + internal RankFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public RankFeatureQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinear? LinearValue { get; set; } + private RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } + private Action LinearDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? LogValue { get; set; } + private RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturation? SaturationValue { get; set; } + private RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } + private Action SaturationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoid? SigmoidValue { get; set; } + private RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + + public RankFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RankFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + public RankFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + public RankFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Linear function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinear? linear) + { + LinearDescriptor = null; + LinearDescriptorAction = null; + LinearValue = linear; + return Self; + } + + public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + { + LinearValue = null; + LinearDescriptorAction = null; + LinearDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Linear(Action configure) + { + LinearValue = null; + LinearDescriptor = null; + LinearDescriptorAction = configure; + return Self; + } + + /// + /// Logarithmic function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? log) + { + LogDescriptor = null; + LogDescriptorAction = null; + LogValue = log; + return Self; + } + + public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + { + LogValue = null; + LogDescriptorAction = null; + LogDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Log(Action configure) + { + LogValue = null; + LogDescriptor = null; + LogDescriptorAction = configure; + return Self; + } + + /// + /// Saturation function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturation? saturation) + { + SaturationDescriptor = null; + SaturationDescriptorAction = null; + SaturationValue = saturation; + return Self; + } + + public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + { + SaturationValue = null; + SaturationDescriptorAction = null; + SaturationDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Saturation(Action configure) + { + SaturationValue = null; + SaturationDescriptor = null; + SaturationDescriptorAction = configure; + return Self; + } + + /// + /// Sigmoid function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoid? sigmoid) + { + SigmoidDescriptor = null; + SigmoidDescriptorAction = null; + SigmoidValue = sigmoid; + return Self; + } + + public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + { + SigmoidValue = null; + SigmoidDescriptorAction = null; + SigmoidDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Sigmoid(Action configure) + { + SigmoidValue = null; + SigmoidDescriptor = null; + SigmoidDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LinearDescriptor is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, LinearDescriptor, options); + } + else if (LinearDescriptorAction is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + } + else if (LinearValue is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, LinearValue, options); + } + + if (LogDescriptor is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, LogDescriptor, options); + } + else if (LogDescriptorAction is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + } + else if (LogValue is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, LogValue, options); + } + + if (SaturationDescriptor is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, SaturationDescriptor, options); + } + else if (SaturationDescriptorAction is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + } + else if (SaturationValue is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, SaturationValue, options); + } + + if (SigmoidDescriptor is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, SigmoidDescriptor, options); + } + else if (SigmoidDescriptorAction is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + } + else if (SigmoidValue is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, SigmoidValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RankFeatureQueryDescriptor : SerializableDescriptor +{ + internal RankFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public RankFeatureQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinear? LinearValue { get; set; } + private RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } + private Action LinearDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? LogValue { get; set; } + private RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturation? SaturationValue { get; set; } + private RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } + private Action SaturationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoid? SigmoidValue { get; set; } + private RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + + public RankFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RankFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + public RankFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + public RankFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// `rank_feature` or `rank_features` field used to boost relevance scores. + /// + public RankFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Linear function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinear? linear) + { + LinearDescriptor = null; + LinearDescriptorAction = null; + LinearValue = linear; + return Self; + } + + public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + { + LinearValue = null; + LinearDescriptorAction = null; + LinearDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Linear(Action configure) + { + LinearValue = null; + LinearDescriptor = null; + LinearDescriptorAction = configure; + return Self; + } + + /// + /// Logarithmic function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? log) + { + LogDescriptor = null; + LogDescriptorAction = null; + LogValue = log; + return Self; + } + + public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + { + LogValue = null; + LogDescriptorAction = null; + LogDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Log(Action configure) + { + LogValue = null; + LogDescriptor = null; + LogDescriptorAction = configure; + return Self; + } + + /// + /// Saturation function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturation? saturation) + { + SaturationDescriptor = null; + SaturationDescriptorAction = null; + SaturationValue = saturation; + return Self; + } + + public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + { + SaturationValue = null; + SaturationDescriptorAction = null; + SaturationDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Saturation(Action configure) + { + SaturationValue = null; + SaturationDescriptor = null; + SaturationDescriptorAction = configure; + return Self; + } + + /// + /// Sigmoid function used to boost relevance scores based on the value of the rank feature `field`. + /// + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoid? sigmoid) + { + SigmoidDescriptor = null; + SigmoidDescriptorAction = null; + SigmoidValue = sigmoid; + return Self; + } + + public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + { + SigmoidValue = null; + SigmoidDescriptorAction = null; + SigmoidDescriptor = descriptor; + return Self; + } + + public RankFeatureQueryDescriptor Sigmoid(Action configure) + { + SigmoidValue = null; + SigmoidDescriptor = null; + SigmoidDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LinearDescriptor is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, LinearDescriptor, options); + } + else if (LinearDescriptorAction is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + } + else if (LinearValue is not null) + { + writer.WritePropertyName("linear"); + JsonSerializer.Serialize(writer, LinearValue, options); + } + + if (LogDescriptor is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, LogDescriptor, options); + } + else if (LogDescriptorAction is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + } + else if (LogValue is not null) + { + writer.WritePropertyName("log"); + JsonSerializer.Serialize(writer, LogValue, options); + } + + if (SaturationDescriptor is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, SaturationDescriptor, options); + } + else if (SaturationDescriptorAction is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + } + else if (SaturationValue is not null) + { + writer.WritePropertyName("saturation"); + JsonSerializer.Serialize(writer, SaturationValue, options); + } + + if (SigmoidDescriptor is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, SigmoidDescriptor, options); + } + else if (SigmoidDescriptorAction is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + } + else if (SigmoidValue is not null) + { + writer.WritePropertyName("sigmoid"); + JsonSerializer.Serialize(writer, SigmoidValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs new file mode 100644 index 00000000000..af1ef664906 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs @@ -0,0 +1,490 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class RegexpQueryConverter : JsonConverter +{ + public override RegexpQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new RegexpQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "case_insensitive") + { + variant.CaseInsensitive = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "flags") + { + variant.Flags = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_determinized_states") + { + variant.MaxDeterminizedStates = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rewrite") + { + variant.Rewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, RegexpQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize RegexpQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } + + if (!string.IsNullOrEmpty(value.Flags)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(value.Flags); + } + + if (value.MaxDeterminizedStates.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(value.MaxDeterminizedStates.Value); + } + + if (value.Rewrite is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, value.Rewrite, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(RegexpQueryConverter))] +public sealed partial class RegexpQuery : SearchQuery +{ + public RegexpQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.
When `false`, case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public bool? CaseInsensitive { get; set; } + + /// + /// Enables optional operators for the regular expression. + /// + public string? Flags { get; set; } + + /// + /// Maximum number of automaton states required for the query. + /// + public int? MaxDeterminizedStates { get; set; } + + /// + /// Method used to rewrite the query. + /// + public string? Rewrite { get; set; } + + /// + /// Regular expression for terms you wish to find in the provided field. + /// + public string Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(RegexpQuery regexpQuery) => QueryDsl.Query.Regexp(regexpQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("regexp", this); +} + +public sealed partial class RegexpQueryDescriptor : SerializableDescriptor> +{ + internal RegexpQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal RegexpQueryDescriptor() : base() + { + } + + public RegexpQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public RegexpQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FlagsValue { get; set; } + private int? MaxDeterminizedStatesValue { get; set; } + private string? RewriteValue { get; set; } + private string ValueValue { get; set; } + + public RegexpQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RegexpQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.
When `false`, case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public RegexpQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public RegexpQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public RegexpQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Enables optional operators for the regular expression. + /// + public RegexpQueryDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + /// + /// Maximum number of automaton states required for the query. + /// + public RegexpQueryDescriptor MaxDeterminizedStates(int? maxDeterminizedStates) + { + MaxDeterminizedStatesValue = maxDeterminizedStates; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public RegexpQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Regular expression for terms you wish to find in the provided field. + /// + public RegexpQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + if (MaxDeterminizedStatesValue.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(MaxDeterminizedStatesValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class RegexpQueryDescriptor : SerializableDescriptor +{ + internal RegexpQueryDescriptor(Action configure) => configure.Invoke(this); + + internal RegexpQueryDescriptor() : base() + { + } + + public RegexpQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FlagsValue { get; set; } + private int? MaxDeterminizedStatesValue { get; set; } + private string? RewriteValue { get; set; } + private string ValueValue { get; set; } + + public RegexpQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RegexpQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.
When `false`, case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public RegexpQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public RegexpQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public RegexpQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RegexpQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Enables optional operators for the regular expression. + /// + public RegexpQueryDescriptor Flags(string? flags) + { + FlagsValue = flags; + return Self; + } + + /// + /// Maximum number of automaton states required for the query. + /// + public RegexpQueryDescriptor MaxDeterminizedStates(int? maxDeterminizedStates) + { + MaxDeterminizedStatesValue = maxDeterminizedStates; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public RegexpQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Regular expression for terms you wish to find in the provided field. + /// + public RegexpQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (!string.IsNullOrEmpty(FlagsValue)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(FlagsValue); + } + + if (MaxDeterminizedStatesValue.HasValue) + { + writer.WritePropertyName("max_determinized_states"); + writer.WriteNumberValue(MaxDeterminizedStatesValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs new file mode 100644 index 00000000000..49a13724b3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -0,0 +1,252 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class RuleQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("match_criteria")] + public object MatchCriteria { get; set; } + [JsonInclude, JsonPropertyName("organic")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Organic { get; set; } + [JsonInclude, JsonPropertyName("ruleset_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id RulesetId { get; set; } + + public static implicit operator Query(RuleQuery ruleQuery) => QueryDsl.Query.RuleQuery(ruleQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("rule_query", this); +} + +public sealed partial class RuleQueryDescriptor : SerializableDescriptor> +{ + internal RuleQueryDescriptor(Action> configure) => configure.Invoke(this); + + public RuleQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } + private QueryDescriptor OrganicDescriptor { get; set; } + private Action> OrganicDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private object MatchCriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organic) + { + OrganicDescriptor = null; + OrganicDescriptorAction = null; + OrganicValue = organic; + return Self; + } + + public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + { + OrganicValue = null; + OrganicDescriptorAction = null; + OrganicDescriptor = descriptor; + return Self; + } + + public RuleQueryDescriptor Organic(Action> configure) + { + OrganicValue = null; + OrganicDescriptor = null; + OrganicDescriptorAction = configure; + return Self; + } + + public RuleQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RuleQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public RuleQueryDescriptor MatchCriteria(object matchCriteria) + { + MatchCriteriaValue = matchCriteria; + return Self; + } + + public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RulesetIdValue = rulesetId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OrganicDescriptor is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicDescriptor, options); + } + else if (OrganicDescriptorAction is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + } + else + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("match_criteria"); + JsonSerializer.Serialize(writer, MatchCriteriaValue, options); + writer.WritePropertyName("ruleset_id"); + JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class RuleQueryDescriptor : SerializableDescriptor +{ + internal RuleQueryDescriptor(Action configure) => configure.Invoke(this); + + public RuleQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } + private QueryDescriptor OrganicDescriptor { get; set; } + private Action OrganicDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private object MatchCriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organic) + { + OrganicDescriptor = null; + OrganicDescriptorAction = null; + OrganicValue = organic; + return Self; + } + + public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + { + OrganicValue = null; + OrganicDescriptorAction = null; + OrganicDescriptor = descriptor; + return Self; + } + + public RuleQueryDescriptor Organic(Action configure) + { + OrganicValue = null; + OrganicDescriptor = null; + OrganicDescriptorAction = configure; + return Self; + } + + public RuleQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public RuleQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public RuleQueryDescriptor MatchCriteria(object matchCriteria) + { + MatchCriteriaValue = matchCriteria; + return Self; + } + + public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RulesetIdValue = rulesetId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OrganicDescriptor is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicDescriptor, options); + } + else if (OrganicDescriptorAction is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + } + else + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, OrganicValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("match_criteria"); + JsonSerializer.Serialize(writer, MatchCriteriaValue, options); + writer.WritePropertyName("ruleset_id"); + JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs new file mode 100644 index 00000000000..6e5d5682db0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ScriptQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Contains a script to run as a query.
This script must return a boolean value, `true` or `false`.
+ ///
+ [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + public static implicit operator Query(ScriptQuery scriptQuery) => QueryDsl.Query.Script(scriptQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("script", this); +} + +public sealed partial class ScriptQueryDescriptor : SerializableDescriptor +{ + internal ScriptQueryDescriptor(Action configure) => configure.Invoke(this); + + public ScriptQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + public ScriptQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ScriptQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Contains a script to run as a query.
This script must return a boolean value, `true` or `false`.
+ ///
+ public ScriptQueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs new file mode 100644 index 00000000000..e556e94fb84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ScriptScoreFunction +{ + /// + /// A script that computes a score. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + public static implicit operator FunctionScore(ScriptScoreFunction scriptScoreFunction) => QueryDsl.FunctionScore.ScriptScore(scriptScoreFunction); +} + +public sealed partial class ScriptScoreFunctionDescriptor : SerializableDescriptor +{ + internal ScriptScoreFunctionDescriptor(Action configure) => configure.Invoke(this); + + public ScriptScoreFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + /// + /// A script that computes a score. + /// + public ScriptScoreFunctionDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs new file mode 100644 index 00000000000..bb22433137f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs @@ -0,0 +1,290 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class ScriptScoreQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Documents with a score lower than this floating point number are excluded from the search results. + /// + [JsonInclude, JsonPropertyName("min_score")] + public float? MinScore { get; set; } + + /// + /// Query used to return documents. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + + /// + /// Script used to compute the score of documents returned by the query.
Important: final relevance scores from the `script_score` query cannot be negative.
+ ///
+ [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + public static implicit operator Query(ScriptScoreQuery scriptScoreQuery) => QueryDsl.Query.ScriptScore(scriptScoreQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("script_score", this); +} + +public sealed partial class ScriptScoreQueryDescriptor : SerializableDescriptor> +{ + internal ScriptScoreQueryDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptScoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private float? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + /// + /// Query used to return documents. + /// + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ScriptScoreQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public ScriptScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ScriptScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Documents with a score lower than this floating point number are excluded from the search results. + /// + public ScriptScoreQueryDescriptor MinScore(float? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Script used to compute the score of documents returned by the query.
Important: final relevance scores from the `script_score` query cannot be negative.
+ ///
+ public ScriptScoreQueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptScoreQueryDescriptor : SerializableDescriptor +{ + internal ScriptScoreQueryDescriptor(Action configure) => configure.Invoke(this); + + public ScriptScoreQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } + private QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private float? MinScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + /// + /// Query used to return documents. + /// + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ScriptScoreQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public ScriptScoreQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public ScriptScoreQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Documents with a score lower than this floating point number are excluded from the search results. + /// + public ScriptScoreQueryDescriptor MinScore(float? minScore) + { + MinScoreValue = minScore; + return Self; + } + + /// + /// Script used to compute the score of documents returned by the query.
Important: final relevance scores from the `script_score` query cannot be negative.
+ ///
+ public ScriptScoreQueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinScoreValue.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(MinScoreValue.Value); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs new file mode 100644 index 00000000000..3b214d98c62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs @@ -0,0 +1,610 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SimpleQueryStringQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + [JsonInclude, JsonPropertyName("analyze_wildcard")] + public bool? AnalyzeWildcard { get; set; } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// If `true`, the parser creates a match_phrase query for each multi-position token. + /// + [JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] + public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + [JsonInclude, JsonPropertyName("default_operator")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get; set; } + + /// + /// Array of fields you wish to search.
Accepts wildcard expressions.
You also can boost relevance scores for matches to particular fields using a caret (`^`) notation.
Defaults to the `index.query.default_field index` setting, which has a default value of `*`.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Fields? Fields { get; set; } + + /// + /// List of enabled operators for the simple query string syntax. + /// + [JsonInclude, JsonPropertyName("flags")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? Flags { get; set; } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("fuzzy_max_expansions")] + public int? FuzzyMaxExpansions { get; set; } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + [JsonInclude, JsonPropertyName("fuzzy_prefix_length")] + public int? FuzzyPrefixLength { get; set; } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + [JsonInclude, JsonPropertyName("fuzzy_transpositions")] + public bool? FuzzyTranspositions { get; set; } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + [JsonInclude, JsonPropertyName("lenient")] + public bool? Lenient { get; set; } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + [JsonInclude, JsonPropertyName("minimum_should_match")] + public Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatch { get; set; } + + /// + /// Query string in the simple query string syntax you wish to parse and use for search. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// Suffix appended to quoted text in the query string. + /// + [JsonInclude, JsonPropertyName("quote_field_suffix")] + public string? QuoteFieldSuffix { get; set; } + + public static implicit operator Query(SimpleQueryStringQuery simpleQueryStringQuery) => QueryDsl.Query.SimpleQueryString(simpleQueryStringQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("simple_query_string", this); +} + +public sealed partial class SimpleQueryStringQueryDescriptor : SerializableDescriptor> +{ + internal SimpleQueryStringQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SimpleQueryStringQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AnalyzeWildcardValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperatorValue { get; set; } + private Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; } + private int? FuzzyMaxExpansionsValue { get; set; } + private int? FuzzyPrefixLengthValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private string QueryValue { get; set; } + private string? QuoteFieldSuffixValue { get; set; } + + public SimpleQueryStringQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + public SimpleQueryStringQueryDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) + { + AnalyzeWildcardValue = analyzeWildcard; + return Self; + } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + public SimpleQueryStringQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, the parser creates a match_phrase query for each multi-position token. + /// + public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public SimpleQueryStringQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) + { + DefaultOperatorValue = defaultOperator; + return Self; + } + + /// + /// Array of fields you wish to search.
Accepts wildcard expressions.
You also can boost relevance scores for matches to particular fields using a caret (`^`) notation.
Defaults to the `index.query.default_field index` setting, which has a default value of `*`.
+ ///
+ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// List of enabled operators for the simple query string syntax. + /// + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? flags) + { + FlagsValue = flags; + return Self; + } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + public SimpleQueryStringQueryDescriptor FuzzyMaxExpansions(int? fuzzyMaxExpansions) + { + FuzzyMaxExpansionsValue = fuzzyMaxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public SimpleQueryStringQueryDescriptor FuzzyPrefixLength(int? fuzzyPrefixLength) + { + FuzzyPrefixLengthValue = fuzzyPrefixLength; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public SimpleQueryStringQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + public SimpleQueryStringQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public SimpleQueryStringQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Query string in the simple query string syntax you wish to parse and use for search. + /// + public SimpleQueryStringQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Suffix appended to quoted text in the query string. + /// + public SimpleQueryStringQueryDescriptor QuoteFieldSuffix(string? quoteFieldSuffix) + { + QuoteFieldSuffixValue = quoteFieldSuffix; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AnalyzeWildcardValue.HasValue) + { + writer.WritePropertyName("analyze_wildcard"); + writer.WriteBooleanValue(AnalyzeWildcardValue.Value); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DefaultOperatorValue is not null) + { + writer.WritePropertyName("default_operator"); + JsonSerializer.Serialize(writer, DefaultOperatorValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FlagsValue is not null) + { + writer.WritePropertyName("flags"); + JsonSerializer.Serialize(writer, FlagsValue, options); + } + + if (FuzzyMaxExpansionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_max_expansions"); + writer.WriteNumberValue(FuzzyMaxExpansionsValue.Value); + } + + if (FuzzyPrefixLengthValue.HasValue) + { + writer.WritePropertyName("fuzzy_prefix_length"); + writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(QuoteFieldSuffixValue)) + { + writer.WritePropertyName("quote_field_suffix"); + writer.WriteStringValue(QuoteFieldSuffixValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SimpleQueryStringQueryDescriptor : SerializableDescriptor +{ + internal SimpleQueryStringQueryDescriptor(Action configure) => configure.Invoke(this); + + public SimpleQueryStringQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private bool? AnalyzeWildcardValue { get; set; } + private string? AnalyzerValue { get; set; } + private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperatorValue { get; set; } + private Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; } + private int? FuzzyMaxExpansionsValue { get; set; } + private int? FuzzyPrefixLengthValue { get; set; } + private bool? FuzzyTranspositionsValue { get; set; } + private bool? LenientValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } + private string QueryValue { get; set; } + private string? QuoteFieldSuffixValue { get; set; } + + public SimpleQueryStringQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// If `true`, the query attempts to analyze wildcard terms in the query string. + /// + public SimpleQueryStringQueryDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) + { + AnalyzeWildcardValue = analyzeWildcard; + return Self; + } + + /// + /// Analyzer used to convert text in the query string into tokens. + /// + public SimpleQueryStringQueryDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// If `true`, the parser creates a match_phrase query for each multi-position token. + /// + public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true) + { + AutoGenerateSynonymsPhraseQueryValue = autoGenerateSynonymsPhraseQuery; + return Self; + } + + public SimpleQueryStringQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Default boolean logic used to interpret text in the query string if no operators are specified. + /// + public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) + { + DefaultOperatorValue = defaultOperator; + return Self; + } + + /// + /// Array of fields you wish to search.
Accepts wildcard expressions.
You also can boost relevance scores for matches to particular fields using a caret (`^`) notation.
Defaults to the `index.query.default_field index` setting, which has a default value of `*`.
+ ///
+ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// List of enabled operators for the simple query string syntax. + /// + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? flags) + { + FlagsValue = flags; + return Self; + } + + /// + /// Maximum number of terms to which the query expands for fuzzy matching. + /// + public SimpleQueryStringQueryDescriptor FuzzyMaxExpansions(int? fuzzyMaxExpansions) + { + FuzzyMaxExpansionsValue = fuzzyMaxExpansions; + return Self; + } + + /// + /// Number of beginning characters left unchanged for fuzzy matching. + /// + public SimpleQueryStringQueryDescriptor FuzzyPrefixLength(int? fuzzyPrefixLength) + { + FuzzyPrefixLengthValue = fuzzyPrefixLength; + return Self; + } + + /// + /// If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + /// + public SimpleQueryStringQueryDescriptor FuzzyTranspositions(bool? fuzzyTranspositions = true) + { + FuzzyTranspositionsValue = fuzzyTranspositions; + return Self; + } + + /// + /// If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + /// + public SimpleQueryStringQueryDescriptor Lenient(bool? lenient = true) + { + LenientValue = lenient; + return Self; + } + + /// + /// Minimum number of clauses that must match for a document to be returned. + /// + public SimpleQueryStringQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? minimumShouldMatch) + { + MinimumShouldMatchValue = minimumShouldMatch; + return Self; + } + + /// + /// Query string in the simple query string syntax you wish to parse and use for search. + /// + public SimpleQueryStringQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// Suffix appended to quoted text in the query string. + /// + public SimpleQueryStringQueryDescriptor QuoteFieldSuffix(string? quoteFieldSuffix) + { + QuoteFieldSuffixValue = quoteFieldSuffix; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (AnalyzeWildcardValue.HasValue) + { + writer.WritePropertyName("analyze_wildcard"); + writer.WriteBooleanValue(AnalyzeWildcardValue.Value); + } + + if (!string.IsNullOrEmpty(AnalyzerValue)) + { + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(AnalyzerValue); + } + + if (AutoGenerateSynonymsPhraseQueryValue.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(AutoGenerateSynonymsPhraseQueryValue.Value); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DefaultOperatorValue is not null) + { + writer.WritePropertyName("default_operator"); + JsonSerializer.Serialize(writer, DefaultOperatorValue, options); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (FlagsValue is not null) + { + writer.WritePropertyName("flags"); + JsonSerializer.Serialize(writer, FlagsValue, options); + } + + if (FuzzyMaxExpansionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_max_expansions"); + writer.WriteNumberValue(FuzzyMaxExpansionsValue.Value); + } + + if (FuzzyPrefixLengthValue.HasValue) + { + writer.WritePropertyName("fuzzy_prefix_length"); + writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); + } + + if (FuzzyTranspositionsValue.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(FuzzyTranspositionsValue.Value); + } + + if (LenientValue.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(LenientValue.Value); + } + + if (MinimumShouldMatchValue is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, MinimumShouldMatchValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(QuoteFieldSuffixValue)) + { + writer.WritePropertyName("quote_field_suffix"); + writer.WriteStringValue(QuoteFieldSuffixValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs new file mode 100644 index 00000000000..1b11993fcae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs @@ -0,0 +1,318 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanContainingQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ [JsonInclude, JsonPropertyName("big")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Big { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ [JsonInclude, JsonPropertyName("little")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Little { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_containing", this); +} + +public sealed partial class SpanContainingQueryDescriptor : SerializableDescriptor> +{ + internal SpanContainingQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanContainingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery BigValue { get; set; } + private SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } + private SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery big) + { + BigDescriptor = null; + BigDescriptorAction = null; + BigValue = big; + return Self; + } + + public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + { + BigValue = null; + BigDescriptorAction = null; + BigDescriptor = descriptor; + return Self; + } + + public SpanContainingQueryDescriptor Big(Action> configure) + { + BigValue = null; + BigDescriptor = null; + BigDescriptorAction = configure; + return Self; + } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery little) + { + LittleDescriptor = null; + LittleDescriptorAction = null; + LittleValue = little; + return Self; + } + + public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + { + LittleValue = null; + LittleDescriptorAction = null; + LittleDescriptor = descriptor; + return Self; + } + + public SpanContainingQueryDescriptor Little(Action> configure) + { + LittleValue = null; + LittleDescriptor = null; + LittleDescriptorAction = configure; + return Self; + } + + public SpanContainingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanContainingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BigDescriptor is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigDescriptor, options); + } + else if (BigDescriptorAction is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + } + else + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigValue, options); + } + + if (LittleDescriptor is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleDescriptor, options); + } + else if (LittleDescriptorAction is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + } + else + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanContainingQueryDescriptor : SerializableDescriptor +{ + internal SpanContainingQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanContainingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery BigValue { get; set; } + private SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } + private SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery big) + { + BigDescriptor = null; + BigDescriptorAction = null; + BigValue = big; + return Self; + } + + public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + { + BigValue = null; + BigDescriptorAction = null; + BigDescriptor = descriptor; + return Self; + } + + public SpanContainingQueryDescriptor Big(Action configure) + { + BigValue = null; + BigDescriptor = null; + BigDescriptorAction = configure; + return Self; + } + + /// + /// Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.
+ ///
+ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery little) + { + LittleDescriptor = null; + LittleDescriptorAction = null; + LittleValue = little; + return Self; + } + + public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + { + LittleValue = null; + LittleDescriptorAction = null; + LittleDescriptor = descriptor; + return Self; + } + + public SpanContainingQueryDescriptor Little(Action configure) + { + LittleValue = null; + LittleDescriptor = null; + LittleDescriptorAction = configure; + return Self; + } + + public SpanContainingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanContainingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BigDescriptor is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigDescriptor, options); + } + else if (BigDescriptorAction is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + } + else + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigValue, options); + } + + if (LittleDescriptor is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleDescriptor, options); + } + else if (LittleDescriptorAction is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + } + else + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs new file mode 100644 index 00000000000..7c6c97d6351 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs @@ -0,0 +1,248 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanFieldMaskingQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Query { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("field_masking_span", this); +} + +public sealed partial class SpanFieldMaskingQueryDescriptor : SerializableDescriptor> +{ + internal SpanFieldMaskingQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanFieldMaskingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery QueryValue { get; set; } + private SpanQueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public SpanFieldMaskingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class SpanFieldMaskingQueryDescriptor : SerializableDescriptor +{ + internal SpanFieldMaskingQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanFieldMaskingQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery QueryValue { get; set; } + private SpanQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + public SpanFieldMaskingQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SpanFieldMaskingQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs new file mode 100644 index 00000000000..713c6ecf51e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs @@ -0,0 +1,250 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanFirstQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Controls the maximum end position permitted in a match. + /// + [JsonInclude, JsonPropertyName("end")] + public int End { get; set; } + + /// + /// Can be any other span type query. + /// + [JsonInclude, JsonPropertyName("match")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Match { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_first", this); +} + +public sealed partial class SpanFirstQueryDescriptor : SerializableDescriptor> +{ + internal SpanFirstQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanFirstQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery MatchValue { get; set; } + private SpanQueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private int EndValue { get; set; } + + /// + /// Can be any other span type query. + /// + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public SpanFirstQueryDescriptor Match(Action> configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + public SpanFirstQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanFirstQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Controls the maximum end position permitted in a match. + /// + public SpanFirstQueryDescriptor End(int end) + { + EndValue = end; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + } + else + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("end"); + writer.WriteNumberValue(EndValue); + writer.WriteEndObject(); + } +} + +public sealed partial class SpanFirstQueryDescriptor : SerializableDescriptor +{ + internal SpanFirstQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanFirstQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery MatchValue { get; set; } + private SpanQueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private int EndValue { get; set; } + + /// + /// Can be any other span type query. + /// + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public SpanFirstQueryDescriptor Match(Action configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + public SpanFirstQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanFirstQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Controls the maximum end position permitted in a match. + /// + public SpanFirstQueryDescriptor End(int end) + { + EndValue = end; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + } + else + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("end"); + writer.WriteNumberValue(EndValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs new file mode 100644 index 00000000000..dbb606b55f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs @@ -0,0 +1,220 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanMultiTermQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Should be a multi term query (one of `wildcard`, `fuzzy`, `prefix`, `range`, or `regexp` query). + /// + [JsonInclude, JsonPropertyName("match")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Match { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_multi", this); +} + +public sealed partial class SpanMultiTermQueryDescriptor : SerializableDescriptor> +{ + internal SpanMultiTermQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanMultiTermQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query MatchValue { get; set; } + private QueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Should be a multi term query (one of `wildcard`, `fuzzy`, `prefix`, `range`, or `regexp` query). + /// + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public SpanMultiTermQueryDescriptor Match(Action> configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + public SpanMultiTermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanMultiTermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + } + else + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanMultiTermQueryDescriptor : SerializableDescriptor +{ + internal SpanMultiTermQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanMultiTermQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query MatchValue { get; set; } + private QueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Should be a multi term query (one of `wildcard`, `fuzzy`, `prefix`, `range`, or `regexp` query). + /// + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public SpanMultiTermQueryDescriptor Match(Action configure) + { + MatchValue = null; + MatchDescriptor = null; + MatchDescriptorAction = configure; + return Self; + } + + public SpanMultiTermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanMultiTermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + } + else + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs new file mode 100644 index 00000000000..ffe1247cded --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs @@ -0,0 +1,352 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanNearQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Array of one or more other span type queries. + /// + [JsonInclude, JsonPropertyName("clauses")] + public ICollection Clauses { get; set; } + + /// + /// Controls whether matches are required to be in-order. + /// + [JsonInclude, JsonPropertyName("in_order")] + public bool? InOrder { get; set; } + + /// + /// Controls the maximum number of intervening unmatched positions permitted. + /// + [JsonInclude, JsonPropertyName("slop")] + public int? Slop { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_near", this); +} + +public sealed partial class SpanNearQueryDescriptor : SerializableDescriptor> +{ + internal SpanNearQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanNearQueryDescriptor() : base() + { + } + + private ICollection ClausesValue { get; set; } + private SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? InOrderValue { get; set; } + private int? SlopValue { get; set; } + + /// + /// Array of one or more other span type queries. + /// + public SpanNearQueryDescriptor Clauses(ICollection clauses) + { + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesValue = clauses; + return Self; + } + + public SpanNearQueryDescriptor Clauses(SpanQueryDescriptor descriptor) + { + ClausesValue = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesDescriptor = descriptor; + return Self; + } + + public SpanNearQueryDescriptor Clauses(Action> configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorActions = null; + ClausesDescriptorAction = configure; + return Self; + } + + public SpanNearQueryDescriptor Clauses(params Action>[] configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = configure; + return Self; + } + + public SpanNearQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanNearQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Controls whether matches are required to be in-order. + /// + public SpanNearQueryDescriptor InOrder(bool? inOrder = true) + { + InOrderValue = inOrder; + return Self; + } + + /// + /// Controls the maximum number of intervening unmatched positions permitted. + /// + public SpanNearQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClausesDescriptor is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ClausesDescriptor, options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorAction is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorActions is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + foreach (var action in ClausesDescriptorActions) + { + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("clauses"); + JsonSerializer.Serialize(writer, ClausesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (InOrderValue.HasValue) + { + writer.WritePropertyName("in_order"); + writer.WriteBooleanValue(InOrderValue.Value); + } + + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanNearQueryDescriptor : SerializableDescriptor +{ + internal SpanNearQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanNearQueryDescriptor() : base() + { + } + + private ICollection ClausesValue { get; set; } + private SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? InOrderValue { get; set; } + private int? SlopValue { get; set; } + + /// + /// Array of one or more other span type queries. + /// + public SpanNearQueryDescriptor Clauses(ICollection clauses) + { + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesValue = clauses; + return Self; + } + + public SpanNearQueryDescriptor Clauses(SpanQueryDescriptor descriptor) + { + ClausesValue = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesDescriptor = descriptor; + return Self; + } + + public SpanNearQueryDescriptor Clauses(Action configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorActions = null; + ClausesDescriptorAction = configure; + return Self; + } + + public SpanNearQueryDescriptor Clauses(params Action[] configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = configure; + return Self; + } + + public SpanNearQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanNearQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Controls whether matches are required to be in-order. + /// + public SpanNearQueryDescriptor InOrder(bool? inOrder = true) + { + InOrderValue = inOrder; + return Self; + } + + /// + /// Controls the maximum number of intervening unmatched positions permitted. + /// + public SpanNearQueryDescriptor Slop(int? slop) + { + SlopValue = slop; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClausesDescriptor is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ClausesDescriptor, options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorAction is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorActions is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + foreach (var action in ClausesDescriptorActions) + { + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("clauses"); + JsonSerializer.Serialize(writer, ClausesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (InOrderValue.HasValue) + { + writer.WritePropertyName("in_order"); + writer.WriteBooleanValue(InOrderValue.Value); + } + + if (SlopValue.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(SlopValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs new file mode 100644 index 00000000000..b5090047a12 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs @@ -0,0 +1,432 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanNotQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The number of tokens from within the include span that can’t have overlap with the exclude span.
Equivalent to setting both `pre` and `post`.
+ ///
+ [JsonInclude, JsonPropertyName("dist")] + public int? Dist { get; set; } + + /// + /// Span query whose matches must not overlap those returned. + /// + [JsonInclude, JsonPropertyName("exclude")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Exclude { get; set; } + + /// + /// Span query whose matches are filtered. + /// + [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Include { get; set; } + + /// + /// The number of tokens after the include span that can’t have overlap with the exclude span. + /// + [JsonInclude, JsonPropertyName("post")] + public int? Post { get; set; } + + /// + /// The number of tokens before the include span that can’t have overlap with the exclude span. + /// + [JsonInclude, JsonPropertyName("pre")] + public int? Pre { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_not", this); +} + +public sealed partial class SpanNotQueryDescriptor : SerializableDescriptor> +{ + internal SpanNotQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanNotQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery ExcludeValue { get; set; } + private SpanQueryDescriptor ExcludeDescriptor { get; set; } + private Action> ExcludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery IncludeValue { get; set; } + private SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action> IncludeDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private int? DistValue { get; set; } + private int? PostValue { get; set; } + private int? PreValue { get; set; } + + /// + /// Span query whose matches must not overlap those returned. + /// + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery exclude) + { + ExcludeDescriptor = null; + ExcludeDescriptorAction = null; + ExcludeValue = exclude; + return Self; + } + + public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + { + ExcludeValue = null; + ExcludeDescriptorAction = null; + ExcludeDescriptor = descriptor; + return Self; + } + + public SpanNotQueryDescriptor Exclude(Action> configure) + { + ExcludeValue = null; + ExcludeDescriptor = null; + ExcludeDescriptorAction = configure; + return Self; + } + + /// + /// Span query whose matches are filtered. + /// + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery include) + { + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeValue = include; + return Self; + } + + public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + { + IncludeValue = null; + IncludeDescriptorAction = null; + IncludeDescriptor = descriptor; + return Self; + } + + public SpanNotQueryDescriptor Include(Action> configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorAction = configure; + return Self; + } + + public SpanNotQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanNotQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The number of tokens from within the include span that can’t have overlap with the exclude span.
Equivalent to setting both `pre` and `post`.
+ ///
+ public SpanNotQueryDescriptor Dist(int? dist) + { + DistValue = dist; + return Self; + } + + /// + /// The number of tokens after the include span that can’t have overlap with the exclude span. + /// + public SpanNotQueryDescriptor Post(int? post) + { + PostValue = post; + return Self; + } + + /// + /// The number of tokens before the include span that can’t have overlap with the exclude span. + /// + public SpanNotQueryDescriptor Pre(int? pre) + { + PreValue = pre; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeDescriptor is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeDescriptor, options); + } + else if (ExcludeDescriptorAction is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + } + else + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (IncludeDescriptor is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeDescriptor, options); + } + else if (IncludeDescriptorAction is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + } + else + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DistValue.HasValue) + { + writer.WritePropertyName("dist"); + writer.WriteNumberValue(DistValue.Value); + } + + if (PostValue.HasValue) + { + writer.WritePropertyName("post"); + writer.WriteNumberValue(PostValue.Value); + } + + if (PreValue.HasValue) + { + writer.WritePropertyName("pre"); + writer.WriteNumberValue(PreValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanNotQueryDescriptor : SerializableDescriptor +{ + internal SpanNotQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanNotQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery ExcludeValue { get; set; } + private SpanQueryDescriptor ExcludeDescriptor { get; set; } + private Action ExcludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery IncludeValue { get; set; } + private SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private int? DistValue { get; set; } + private int? PostValue { get; set; } + private int? PreValue { get; set; } + + /// + /// Span query whose matches must not overlap those returned. + /// + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery exclude) + { + ExcludeDescriptor = null; + ExcludeDescriptorAction = null; + ExcludeValue = exclude; + return Self; + } + + public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + { + ExcludeValue = null; + ExcludeDescriptorAction = null; + ExcludeDescriptor = descriptor; + return Self; + } + + public SpanNotQueryDescriptor Exclude(Action configure) + { + ExcludeValue = null; + ExcludeDescriptor = null; + ExcludeDescriptorAction = configure; + return Self; + } + + /// + /// Span query whose matches are filtered. + /// + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery include) + { + IncludeDescriptor = null; + IncludeDescriptorAction = null; + IncludeValue = include; + return Self; + } + + public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + { + IncludeValue = null; + IncludeDescriptorAction = null; + IncludeDescriptor = descriptor; + return Self; + } + + public SpanNotQueryDescriptor Include(Action configure) + { + IncludeValue = null; + IncludeDescriptor = null; + IncludeDescriptorAction = configure; + return Self; + } + + public SpanNotQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanNotQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The number of tokens from within the include span that can’t have overlap with the exclude span.
Equivalent to setting both `pre` and `post`.
+ ///
+ public SpanNotQueryDescriptor Dist(int? dist) + { + DistValue = dist; + return Self; + } + + /// + /// The number of tokens after the include span that can’t have overlap with the exclude span. + /// + public SpanNotQueryDescriptor Post(int? post) + { + PostValue = post; + return Self; + } + + /// + /// The number of tokens before the include span that can’t have overlap with the exclude span. + /// + public SpanNotQueryDescriptor Pre(int? pre) + { + PreValue = pre; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeDescriptor is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeDescriptor, options); + } + else if (ExcludeDescriptorAction is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + } + else + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + if (IncludeDescriptor is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeDescriptor, options); + } + else if (IncludeDescriptorAction is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + } + else + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (DistValue.HasValue) + { + writer.WritePropertyName("dist"); + writer.WriteNumberValue(DistValue.Value); + } + + if (PostValue.HasValue) + { + writer.WritePropertyName("post"); + writer.WriteNumberValue(PostValue.Value); + } + + if (PreValue.HasValue) + { + writer.WritePropertyName("pre"); + writer.WriteNumberValue(PreValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs new file mode 100644 index 00000000000..eefff7850d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs @@ -0,0 +1,276 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanOrQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Array of one or more other span type queries. + /// + [JsonInclude, JsonPropertyName("clauses")] + public ICollection Clauses { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_or", this); +} + +public sealed partial class SpanOrQueryDescriptor : SerializableDescriptor> +{ + internal SpanOrQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanOrQueryDescriptor() : base() + { + } + + private ICollection ClausesValue { get; set; } + private SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Array of one or more other span type queries. + /// + public SpanOrQueryDescriptor Clauses(ICollection clauses) + { + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesValue = clauses; + return Self; + } + + public SpanOrQueryDescriptor Clauses(SpanQueryDescriptor descriptor) + { + ClausesValue = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesDescriptor = descriptor; + return Self; + } + + public SpanOrQueryDescriptor Clauses(Action> configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorActions = null; + ClausesDescriptorAction = configure; + return Self; + } + + public SpanOrQueryDescriptor Clauses(params Action>[] configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = configure; + return Self; + } + + public SpanOrQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanOrQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClausesDescriptor is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ClausesDescriptor, options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorAction is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorActions is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + foreach (var action in ClausesDescriptorActions) + { + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("clauses"); + JsonSerializer.Serialize(writer, ClausesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanOrQueryDescriptor : SerializableDescriptor +{ + internal SpanOrQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanOrQueryDescriptor() : base() + { + } + + private ICollection ClausesValue { get; set; } + private SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Array of one or more other span type queries. + /// + public SpanOrQueryDescriptor Clauses(ICollection clauses) + { + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesValue = clauses; + return Self; + } + + public SpanOrQueryDescriptor Clauses(SpanQueryDescriptor descriptor) + { + ClausesValue = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = null; + ClausesDescriptor = descriptor; + return Self; + } + + public SpanOrQueryDescriptor Clauses(Action configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorActions = null; + ClausesDescriptorAction = configure; + return Self; + } + + public SpanOrQueryDescriptor Clauses(params Action[] configure) + { + ClausesValue = null; + ClausesDescriptor = null; + ClausesDescriptorAction = null; + ClausesDescriptorActions = configure; + return Self; + } + + public SpanOrQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanOrQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClausesDescriptor is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ClausesDescriptor, options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorAction is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ClausesDescriptorActions is not null) + { + writer.WritePropertyName("clauses"); + writer.WriteStartArray(); + foreach (var action in ClausesDescriptorActions) + { + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("clauses"); + JsonSerializer.Serialize(writer, ClausesValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs new file mode 100644 index 00000000000..1b6638e5d8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs @@ -0,0 +1,335 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(SpanQueryConverter))] +public sealed partial class SpanQuery +{ + internal SpanQuery(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static SpanQuery FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => new SpanQuery("field_masking_span", spanFieldMaskingQuery); + public static SpanQuery SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => new SpanQuery("span_containing", spanContainingQuery); + public static SpanQuery SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => new SpanQuery("span_first", spanFirstQuery); + public static SpanQuery SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => new SpanQuery("span_multi", spanMultiTermQuery); + public static SpanQuery SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => new SpanQuery("span_near", spanNearQuery); + public static SpanQuery SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => new SpanQuery("span_not", spanNotQuery); + public static SpanQuery SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => new SpanQuery("span_or", spanOrQuery); + public static SpanQuery SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => new SpanQuery("span_term", spanTermQuery); + public static SpanQuery SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => new SpanQuery("span_within", spanWithinQuery); +} + +internal sealed partial class SpanQueryConverter : JsonConverter +{ + public override SpanQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "field_masking_span") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_containing") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_first") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_multi") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_near") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_not") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_or") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_term") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + if (propertyName == "span_within") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new SpanQuery(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, SpanQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "field_masking_span": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery)value.Variant, options); + break; + case "span_containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery)value.Variant, options); + break; + case "span_first": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery)value.Variant, options); + break; + case "span_multi": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery)value.Variant, options); + break; + case "span_near": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery)value.Variant, options); + break; + case "span_not": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery)value.Variant, options); + break; + case "span_or": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery)value.Variant, options); + break; + case "span_term": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery)value.Variant, options); + break; + case "span_within": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanQueryDescriptor : SerializableDescriptor> +{ + internal SpanQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SpanQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SpanQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SpanQueryDescriptor FieldMaskingSpan(SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanMulti(SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public SpanQueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class SpanQueryDescriptor : SerializableDescriptor +{ + internal SpanQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SpanQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SpanQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SpanQueryDescriptor FieldMaskingSpan(SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanMulti(SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public SpanQueryDescriptor SpanWithin(Action configure) => Set(configure, "span_within"); + public SpanQueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs new file mode 100644 index 00000000000..44ef7a02047 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs @@ -0,0 +1,282 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class SpanTermQueryConverter : JsonConverter +{ + public override SpanTermQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new SpanTermQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, SpanTermQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize SpanTermQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(SpanTermQueryConverter))] +public sealed partial class SpanTermQuery : SearchQuery +{ + public SpanTermQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + public string Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_term", this); +} + +public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor> +{ + internal SpanTermQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal SpanTermQueryDescriptor() : base() + { + } + + public SpanTermQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public SpanTermQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string ValueValue { get; set; } + + public SpanTermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanTermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public SpanTermQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SpanTermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SpanTermQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor +{ + internal SpanTermQueryDescriptor(Action configure) => configure.Invoke(this); + + internal SpanTermQueryDescriptor() : base() + { + } + + public SpanTermQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string ValueValue { get; set; } + + public SpanTermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanTermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public SpanTermQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public SpanTermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SpanTermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SpanTermQueryDescriptor Value(string value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs new file mode 100644 index 00000000000..328ead205e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs @@ -0,0 +1,318 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class SpanWithinQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ [JsonInclude, JsonPropertyName("big")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Big { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ [JsonInclude, JsonPropertyName("little")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Little { get; set; } + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_within", this); +} + +public sealed partial class SpanWithinQueryDescriptor : SerializableDescriptor> +{ + internal SpanWithinQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SpanWithinQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery BigValue { get; set; } + private SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } + private SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery big) + { + BigDescriptor = null; + BigDescriptorAction = null; + BigValue = big; + return Self; + } + + public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + { + BigValue = null; + BigDescriptorAction = null; + BigDescriptor = descriptor; + return Self; + } + + public SpanWithinQueryDescriptor Big(Action> configure) + { + BigValue = null; + BigDescriptor = null; + BigDescriptorAction = configure; + return Self; + } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery little) + { + LittleDescriptor = null; + LittleDescriptorAction = null; + LittleValue = little; + return Self; + } + + public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + { + LittleValue = null; + LittleDescriptorAction = null; + LittleDescriptor = descriptor; + return Self; + } + + public SpanWithinQueryDescriptor Little(Action> configure) + { + LittleValue = null; + LittleDescriptor = null; + LittleDescriptorAction = configure; + return Self; + } + + public SpanWithinQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanWithinQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BigDescriptor is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigDescriptor, options); + } + else if (BigDescriptorAction is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + } + else + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigValue, options); + } + + if (LittleDescriptor is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleDescriptor, options); + } + else if (LittleDescriptorAction is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + } + else + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SpanWithinQueryDescriptor : SerializableDescriptor +{ + internal SpanWithinQueryDescriptor(Action configure) => configure.Invoke(this); + + public SpanWithinQueryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery BigValue { get; set; } + private SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } + private SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery big) + { + BigDescriptor = null; + BigDescriptorAction = null; + BigValue = big; + return Self; + } + + public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + { + BigValue = null; + BigDescriptorAction = null; + BigDescriptor = descriptor; + return Self; + } + + public SpanWithinQueryDescriptor Big(Action configure) + { + BigValue = null; + BigDescriptor = null; + BigDescriptorAction = configure; + return Self; + } + + /// + /// Can be any span query.
Matching spans from `little` that are enclosed within `big` are returned.
+ ///
+ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery little) + { + LittleDescriptor = null; + LittleDescriptorAction = null; + LittleValue = little; + return Self; + } + + public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + { + LittleValue = null; + LittleDescriptorAction = null; + LittleDescriptor = descriptor; + return Self; + } + + public SpanWithinQueryDescriptor Little(Action configure) + { + LittleValue = null; + LittleDescriptor = null; + LittleDescriptorAction = configure; + return Self; + } + + public SpanWithinQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SpanWithinQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BigDescriptor is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigDescriptor, options); + } + else if (BigDescriptorAction is not null) + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + } + else + { + writer.WritePropertyName("big"); + JsonSerializer.Serialize(writer, BigValue, options); + } + + if (LittleDescriptor is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleDescriptor, options); + } + else if (LittleDescriptorAction is not null) + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + } + else + { + writer.WritePropertyName("little"); + JsonSerializer.Serialize(writer, LittleValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs new file mode 100644 index 00000000000..dbcb560e43b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs @@ -0,0 +1,343 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class TermQueryConverter : JsonConverter +{ + public override TermQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new TermQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "case_insensitive") + { + variant.CaseInsensitive = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, TermQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize TermQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(TermQueryConverter))] +public sealed partial class TermQuery : SearchQuery +{ + public TermQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
When `false`, the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public bool? CaseInsensitive { get; set; } + + /// + /// Term you wish to find in the provided field. + /// + public Elastic.Clients.Elasticsearch.Serverless.FieldValue Value { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(TermQuery termQuery) => QueryDsl.Query.Term(termQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("term", this); +} + +public sealed partial class TermQueryDescriptor : SerializableDescriptor> +{ + internal TermQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal TermQueryDescriptor() : base() + { + } + + public TermQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public TermQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue ValueValue { get; set; } + + public TermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
When `false`, the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public TermQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public TermQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Term you wish to find in the provided field. + /// + public TermQueryDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.FieldValue value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class TermQueryDescriptor : SerializableDescriptor +{ + internal TermQueryDescriptor(Action configure) => configure.Invoke(this); + + internal TermQueryDescriptor() : base() + { + } + + public TermQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue ValueValue { get; set; } + + public TermQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.
When `false`, the case sensitivity of matching depends on the underlying field’s mapping.
+ ///
+ public TermQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public TermQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Term you wish to find in the provided field. + /// + public TermQueryDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.FieldValue value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, ValueValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs new file mode 100644 index 00000000000..39238258a2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class TermsLookup +{ + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Field Path { get; set; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } +} + +public sealed partial class TermsLookupDescriptor : SerializableDescriptor> +{ + internal TermsLookupDescriptor(Action> configure) => configure.Invoke(this); + + public TermsLookupDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + + public TermsLookupDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public TermsLookupDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + public TermsLookupDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + public TermsLookupDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TermsLookupDescriptor : SerializableDescriptor +{ + internal TermsLookupDescriptor(Action configure) => configure.Invoke(this); + + public TermsLookupDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } + + public TermsLookupDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public TermsLookupDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + public TermsLookupDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field path) + { + PathValue = path; + return Self; + } + + public TermsLookupDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public TermsLookupDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); + if (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs new file mode 100644 index 00000000000..d222b19f54d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -0,0 +1,249 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class TermsQueryConverter : JsonConverter +{ + public override TermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new TermsQuery(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Terms = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Terms is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Terms, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TermsQueryConverter))] +public sealed partial class TermsQuery : SearchQuery +{ + public string? QueryName { get; set; } + public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField Terms { get; set; } + + public static implicit operator Query(TermsQuery termsQuery) => QueryDsl.Query.Terms(termsQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("terms", this); +} + +public sealed partial class TermsQueryDescriptor : SerializableDescriptor> +{ + internal TermsQueryDescriptor(Action> configure) => configure.Invoke(this); + + public TermsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + + public TermsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + { + TermsValue = terms; + return Self; + } + + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && TermsValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TermsQueryDescriptor : SerializableDescriptor +{ + internal TermsQueryDescriptor(Action configure) => configure.Invoke(this); + + public TermsQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + + public TermsQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermsQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + { + TermsValue = terms; + return Self; + } + + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && TermsValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs new file mode 100644 index 00000000000..f26f8a8b013 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class TermsQueryField : Union, Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsLookup> +{ + public TermsQueryField(IReadOnlyCollection value) : base(value) + { + } + + public TermsQueryField(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsLookup lookup) : base(lookup) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs new file mode 100644 index 00000000000..0f0e0f25cf7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs @@ -0,0 +1,419 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class TermsSetQueryConverter : JsonConverter +{ + public override TermsSetQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new TermsSetQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "minimum_should_match_field") + { + variant.MinimumShouldMatchField = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "minimum_should_match_script") + { + variant.MinimumShouldMatchScript = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "terms") + { + variant.Terms = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, TermsSetQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize TermsSetQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.MinimumShouldMatchField is not null) + { + writer.WritePropertyName("minimum_should_match_field"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatchField, options); + } + + if (value.MinimumShouldMatchScript is not null) + { + writer.WritePropertyName("minimum_should_match_script"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatchScript, options); + } + + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, value.Terms, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(TermsSetQueryConverter))] +public sealed partial class TermsSetQuery : SearchQuery +{ + public TermsSetQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? MinimumShouldMatchField { get; set; } + + /// + /// Custom script containing the number of matching terms required to return a document. + /// + public Elastic.Clients.Elasticsearch.Serverless.Script? MinimumShouldMatchScript { get; set; } + + /// + /// Array of terms you wish to find in the provided field. + /// + public ICollection Terms { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(TermsSetQuery termsSetQuery) => QueryDsl.Query.TermsSet(termsSetQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("terms_set", this); +} + +public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor> +{ + internal TermsSetQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal TermsSetQueryDescriptor() : base() + { + } + + public TermsSetQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public TermsSetQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? MinimumShouldMatchFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? MinimumShouldMatchScriptValue { get; set; } + private ICollection TermsValue { get; set; } + + public TermsSetQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermsSetQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermsSetQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermsSetQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchField(Elastic.Clients.Elasticsearch.Serverless.Field? minimumShouldMatchField) + { + MinimumShouldMatchFieldValue = minimumShouldMatchField; + return Self; + } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchField(Expression> minimumShouldMatchField) + { + MinimumShouldMatchFieldValue = minimumShouldMatchField; + return Self; + } + + /// + /// Custom script containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchScript(Elastic.Clients.Elasticsearch.Serverless.Script? minimumShouldMatchScript) + { + MinimumShouldMatchScriptValue = minimumShouldMatchScript; + return Self; + } + + /// + /// Array of terms you wish to find in the provided field. + /// + public TermsSetQueryDescriptor Terms(ICollection terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinimumShouldMatchFieldValue is not null) + { + writer.WritePropertyName("minimum_should_match_field"); + JsonSerializer.Serialize(writer, MinimumShouldMatchFieldValue, options); + } + + if (MinimumShouldMatchScriptValue is not null) + { + writer.WritePropertyName("minimum_should_match_script"); + JsonSerializer.Serialize(writer, MinimumShouldMatchScriptValue, options); + } + + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor +{ + internal TermsSetQueryDescriptor(Action configure) => configure.Invoke(this); + + internal TermsSetQueryDescriptor() : base() + { + } + + public TermsSetQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? MinimumShouldMatchFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? MinimumShouldMatchScriptValue { get; set; } + private ICollection TermsValue { get; set; } + + public TermsSetQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TermsSetQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermsSetQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermsSetQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermsSetQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchField(Elastic.Clients.Elasticsearch.Serverless.Field? minimumShouldMatchField) + { + MinimumShouldMatchFieldValue = minimumShouldMatchField; + return Self; + } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchField(Expression> minimumShouldMatchField) + { + MinimumShouldMatchFieldValue = minimumShouldMatchField; + return Self; + } + + /// + /// Numeric field containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchField(Expression> minimumShouldMatchField) + { + MinimumShouldMatchFieldValue = minimumShouldMatchField; + return Self; + } + + /// + /// Custom script containing the number of matching terms required to return a document. + /// + public TermsSetQueryDescriptor MinimumShouldMatchScript(Elastic.Clients.Elasticsearch.Serverless.Script? minimumShouldMatchScript) + { + MinimumShouldMatchScriptValue = minimumShouldMatchScript; + return Self; + } + + /// + /// Array of terms you wish to find in the provided field. + /// + public TermsSetQueryDescriptor Terms(ICollection terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (MinimumShouldMatchFieldValue is not null) + { + writer.WritePropertyName("minimum_should_match_field"); + JsonSerializer.Serialize(writer, MinimumShouldMatchFieldValue, options); + } + + if (MinimumShouldMatchScriptValue is not null) + { + writer.WritePropertyName("minimum_should_match_script"); + JsonSerializer.Serialize(writer, MinimumShouldMatchScriptValue, options); + } + + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs new file mode 100644 index 00000000000..959510bf036 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs @@ -0,0 +1,331 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class TextExpansionQueryConverter : JsonConverter +{ + public override TextExpansionQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new TextExpansionQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "model_id") + { + variant.ModelId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "model_text") + { + variant.ModelText = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, TextExpansionQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize TextExpansionQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + writer.WritePropertyName("model_id"); + writer.WriteStringValue(value.ModelId); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(value.ModelText); + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(TextExpansionQueryConverter))] +public sealed partial class TextExpansionQuery : SearchQuery +{ + public TextExpansionQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// The text expansion NLP model to use + /// + public string ModelId { get; set; } + + /// + /// The query text + /// + public string ModelText { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(TextExpansionQuery textExpansionQuery) => QueryDsl.Query.TextExpansion(textExpansionQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("text_expansion", this); +} + +public sealed partial class TextExpansionQueryDescriptor : SerializableDescriptor> +{ + internal TextExpansionQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal TextExpansionQueryDescriptor() : base() + { + } + + public TextExpansionQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public TextExpansionQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string ModelIdValue { get; set; } + private string ModelTextValue { get; set; } + + public TextExpansionQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TextExpansionQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TextExpansionQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TextExpansionQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The text expansion NLP model to use + /// + public TextExpansionQueryDescriptor ModelId(string modelId) + { + ModelIdValue = modelId; + return Self; + } + + /// + /// The query text + /// + public TextExpansionQueryDescriptor ModelText(string modelText) + { + ModelTextValue = modelText; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("model_id"); + writer.WriteStringValue(ModelIdValue); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(ModelTextValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class TextExpansionQueryDescriptor : SerializableDescriptor +{ + internal TextExpansionQueryDescriptor(Action configure) => configure.Invoke(this); + + internal TextExpansionQueryDescriptor() : base() + { + } + + public TextExpansionQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string ModelIdValue { get; set; } + private string ModelTextValue { get; set; } + + public TextExpansionQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public TextExpansionQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TextExpansionQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TextExpansionQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TextExpansionQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The text expansion NLP model to use + /// + public TextExpansionQueryDescriptor ModelId(string modelId) + { + ModelIdValue = modelId; + return Self; + } + + /// + /// The query text + /// + public TextExpansionQueryDescriptor ModelText(string modelText) + { + ModelTextValue = modelText; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("model_id"); + writer.WriteStringValue(ModelIdValue); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(ModelTextValue); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs new file mode 100644 index 00000000000..6db116334cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs @@ -0,0 +1,453 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class WildcardQueryConverter : JsonConverter +{ + public override WildcardQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new WildcardQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "case_insensitive") + { + variant.CaseInsensitive = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rewrite") + { + variant.Rewrite = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "value") + { + variant.Value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "wildcard") + { + variant.Wildcard = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, WildcardQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize WildcardQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (options.TryGetClientSettings(out var settings)) + { + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } + + if (value.Rewrite is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, value.Rewrite, options); + } + + if (!string.IsNullOrEmpty(value.Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + } + + if (!string.IsNullOrEmpty(value.Wildcard)) + { + writer.WritePropertyName("wildcard"); + writer.WriteStringValue(value.Wildcard); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + return; + } + + throw new JsonException("Unable to retrieve client settings required to infer field."); + } +} + +[JsonConverter(typeof(WildcardQueryConverter))] +public sealed partial class WildcardQuery : SearchQuery +{ + public WildcardQuery(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + public string? QueryName { get; set; } + public float? Boost { get; set; } + + /// + /// Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. + /// + public bool? CaseInsensitive { get; set; } + + /// + /// Method used to rewrite the query. + /// + public string? Rewrite { get; set; } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set. + /// + public string? Value { get; set; } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set. + /// + public string? Wildcard { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Query(WildcardQuery wildcardQuery) => QueryDsl.Query.Wildcard(wildcardQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("wildcard", this); +} + +public sealed partial class WildcardQueryDescriptor : SerializableDescriptor> +{ + internal WildcardQueryDescriptor(Action> configure) => configure.Invoke(this); + + internal WildcardQueryDescriptor() : base() + { + } + + public WildcardQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + public WildcardQueryDescriptor(Expression> field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? RewriteValue { get; set; } + private string? ValueValue { get; set; } + private string? WildcardValue { get; set; } + + public WildcardQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public WildcardQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. + /// + public WildcardQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public WildcardQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public WildcardQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public WildcardQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set. + /// + public WildcardQueryDescriptor Value(string? value) + { + ValueValue = value; + return Self; + } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set. + /// + public WildcardQueryDescriptor Wildcard(string? wildcard) + { + WildcardValue = wildcard; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (!string.IsNullOrEmpty(ValueValue)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + } + + if (!string.IsNullOrEmpty(WildcardValue)) + { + writer.WritePropertyName("wildcard"); + writer.WriteStringValue(WildcardValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class WildcardQueryDescriptor : SerializableDescriptor +{ + internal WildcardQueryDescriptor(Action configure) => configure.Invoke(this); + + internal WildcardQueryDescriptor() : base() + { + } + + public WildcardQueryDescriptor(Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + FieldValue = field; + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private bool? CaseInsensitiveValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? RewriteValue { get; set; } + private string? ValueValue { get; set; } + private string? WildcardValue { get; set; } + + public WildcardQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public WildcardQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. + /// + public WildcardQueryDescriptor CaseInsensitive(bool? caseInsensitive = true) + { + CaseInsensitiveValue = caseInsensitive; + return Self; + } + + public WildcardQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public WildcardQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public WildcardQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Method used to rewrite the query. + /// + public WildcardQueryDescriptor Rewrite(string? rewrite) + { + RewriteValue = rewrite; + return Self; + } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set. + /// + public WildcardQueryDescriptor Value(string? value) + { + ValueValue = value; + return Self; + } + + /// + /// Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set. + /// + public WildcardQueryDescriptor Wildcard(string? wildcard) + { + WildcardValue = wildcard; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CaseInsensitiveValue.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(CaseInsensitiveValue.Value); + } + + if (RewriteValue is not null) + { + writer.WritePropertyName("rewrite"); + JsonSerializer.Serialize(writer, RewriteValue, options); + } + + if (!string.IsNullOrEmpty(ValueValue)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(ValueValue); + } + + if (!string.IsNullOrEmpty(WildcardValue)) + { + writer.WritePropertyName("wildcard"); + writer.WriteStringValue(WildcardValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs new file mode 100644 index 00000000000..86c6b164f21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class WrapperQuery : SearchQuery +{ + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// A base64 encoded query.
The binary data format can be any of JSON, YAML, CBOR or SMILE encodings
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + public static implicit operator Query(WrapperQuery wrapperQuery) => QueryDsl.Query.Wrapper(wrapperQuery); + + internal override void InternalWrapInContainer(Query container) => container.WrapVariant("wrapper", this); +} + +public sealed partial class WrapperQueryDescriptor : SerializableDescriptor +{ + internal WrapperQueryDescriptor(Action configure) => configure.Invoke(this); + + public WrapperQueryDescriptor() : base() + { + } + + private string? QueryNameValue { get; set; } + private float? BoostValue { get; set; } + private string QueryValue { get; set; } + + public WrapperQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public WrapperQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// A base64 encoded query.
The binary data format can be any of JSON, YAML, CBOR or SMILE encodings
+ ///
+ public WrapperQueryDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs new file mode 100644 index 00000000000..6975be907fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +[JsonConverter(typeof(QueryVectorBuilderConverter))] +public sealed partial class QueryVectorBuilder +{ + internal QueryVectorBuilder(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static QueryVectorBuilder TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.TextEmbedding textEmbedding) => new QueryVectorBuilder("text_embedding", textEmbedding); +} + +internal sealed partial class QueryVectorBuilderConverter : JsonConverter +{ + public override QueryVectorBuilder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "text_embedding") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new QueryVectorBuilder(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, QueryVectorBuilder value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.TextEmbedding)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class QueryVectorBuilderDescriptor : SerializableDescriptor> +{ + internal QueryVectorBuilderDescriptor(Action> configure) => configure.Invoke(this); + + public QueryVectorBuilderDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private QueryVectorBuilderDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private QueryVectorBuilderDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class QueryVectorBuilderDescriptor : SerializableDescriptor +{ + internal QueryVectorBuilderDescriptor(Action configure) => configure.Invoke(this); + + public QueryVectorBuilderDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private QueryVectorBuilderDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private QueryVectorBuilderDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs new file mode 100644 index 00000000000..fedfcf9ab36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +[JsonConverter(typeof(RankConverter))] +public sealed partial class Rank +{ + internal Rank(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static Rank Rrf(Elastic.Clients.Elasticsearch.Serverless.RrfRank rrfRank) => new Rank("rrf", rrfRank); +} + +internal sealed partial class RankConverter : JsonConverter +{ + public override Rank Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "rrf") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new Rank(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, Rank value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "rrf": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.RrfRank)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RankDescriptor : SerializableDescriptor> +{ + internal RankDescriptor(Action> configure) => configure.Invoke(this); + + public RankDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RankDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private RankDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); + public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class RankDescriptor : SerializableDescriptor +{ + internal RankDescriptor(Action configure) => configure.Invoke(this); + + public RankDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RankDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private RankDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); + public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RecoveryStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RecoveryStats.g.cs new file mode 100644 index 00000000000..55616ca2e55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RecoveryStats.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RecoveryStats +{ + [JsonInclude, JsonPropertyName("current_as_source")] + public long CurrentAsSource { get; init; } + [JsonInclude, JsonPropertyName("current_as_target")] + public long CurrentAsTarget { get; init; } + [JsonInclude, JsonPropertyName("throttle_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("throttle_time_in_millis")] + public long ThrottleTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RefreshStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RefreshStats.g.cs new file mode 100644 index 00000000000..12b376f83ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RefreshStats.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RefreshStats +{ + [JsonInclude, JsonPropertyName("external_total")] + public long ExternalTotal { get; init; } + [JsonInclude, JsonPropertyName("external_total_time_in_millis")] + public long ExternalTotalTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("listeners")] + public long Listeners { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RequestCacheStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RequestCacheStats.g.cs new file mode 100644 index 00000000000..23dc7daa443 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RequestCacheStats.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RequestCacheStats +{ + [JsonInclude, JsonPropertyName("evictions")] + public long Evictions { get; init; } + [JsonInclude, JsonPropertyName("hit_count")] + public long HitCount { get; init; } + [JsonInclude, JsonPropertyName("memory_size")] + public string? MemorySize { get; init; } + [JsonInclude, JsonPropertyName("memory_size_in_bytes")] + public long MemorySizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("miss_count")] + public long MissCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Retries.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Retries.g.cs new file mode 100644 index 00000000000..4cd24f50923 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Retries.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class Retries +{ + [JsonInclude, JsonPropertyName("bulk")] + public long Bulk { get; init; } + [JsonInclude, JsonPropertyName("search")] + public long Search { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs new file mode 100644 index 00000000000..a5a3e2dfc58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs @@ -0,0 +1,93 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class RrfRank +{ + /// + /// How much influence documents in individual result sets per query have over the final ranked result set + /// + [JsonInclude, JsonPropertyName("rank_constant")] + public long? RankConstant { get; set; } + + /// + /// Size of the individual result sets per query + /// + [JsonInclude, JsonPropertyName("window_size")] + public long? WindowSize { get; set; } + + public static implicit operator Rank(RrfRank rrfRank) => Rank.Rrf(rrfRank); +} + +public sealed partial class RrfRankDescriptor : SerializableDescriptor +{ + internal RrfRankDescriptor(Action configure) => configure.Invoke(this); + + public RrfRankDescriptor() : base() + { + } + + private long? RankConstantValue { get; set; } + private long? WindowSizeValue { get; set; } + + /// + /// How much influence documents in individual result sets per query have over the final ranked result set + /// + public RrfRankDescriptor RankConstant(long? rankConstant) + { + RankConstantValue = rankConstant; + return Self; + } + + /// + /// Size of the individual result sets per query + /// + public RrfRankDescriptor WindowSize(long? windowSize) + { + WindowSizeValue = windowSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RankConstantValue.HasValue) + { + writer.WritePropertyName("rank_constant"); + writer.WriteNumberValue(RankConstantValue.Value); + } + + if (WindowSizeValue.HasValue) + { + writer.WritePropertyName("window_size"); + writer.WriteNumberValue(WindowSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScoreSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScoreSort.g.cs new file mode 100644 index 00000000000..0d449ab5a07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScoreSort.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ScoreSort +{ + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } +} + +public sealed partial class ScoreSortDescriptor : SerializableDescriptor +{ + internal ScoreSortDescriptor(Action configure) => configure.Invoke(this); + + public ScoreSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + + public ScoreSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs new file mode 100644 index 00000000000..13c5f685566 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class Script : Union +{ + public Script(Elastic.Clients.Elasticsearch.Serverless.InlineScript inline) : base(inline) + { + } + + public Script(Elastic.Clients.Elasticsearch.Serverless.StoredScriptId stored) : base(stored) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptField.g.cs new file mode 100644 index 00000000000..35020ff8d2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptField.g.cs @@ -0,0 +1,74 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ScriptField +{ + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } +} + +public sealed partial class ScriptFieldDescriptor : SerializableDescriptor +{ + internal ScriptFieldDescriptor(Action configure) => configure.Invoke(this); + + public ScriptFieldDescriptor() : base() + { + } + + private bool? IgnoreFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + + public ScriptFieldDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + public ScriptFieldDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs new file mode 100644 index 00000000000..8b90703defb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs @@ -0,0 +1,258 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ScriptSort +{ + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } + [JsonInclude, JsonPropertyName("nested")] + public Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? Nested { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? Type { get; set; } + + public static implicit operator SortOptions(ScriptSort scriptSort) => SortOptions.Script(scriptSort); +} + +public sealed partial class ScriptSortDescriptor : SerializableDescriptor> +{ + internal ScriptSortDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? TypeValue { get; set; } + + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public ScriptSortDescriptor Nested(Action> configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public ScriptSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public ScriptSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public ScriptSortDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + public ScriptSortDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptSortDescriptor : SerializableDescriptor +{ + internal ScriptSortDescriptor(Action configure) => configure.Invoke(this); + + public ScriptSortDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } + private NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? TypeValue { get; set; } + + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? nested) + { + NestedDescriptor = null; + NestedDescriptorAction = null; + NestedValue = nested; + return Self; + } + + public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + { + NestedValue = null; + NestedDescriptorAction = null; + NestedDescriptor = descriptor; + return Self; + } + + public ScriptSortDescriptor Nested(Action configure) + { + NestedValue = null; + NestedDescriptor = null; + NestedDescriptorAction = configure; + return Self; + } + + public ScriptSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + { + ModeValue = mode; + return Self; + } + + public ScriptSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public ScriptSortDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + public ScriptSortDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (NestedDescriptor is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedDescriptor, options); + } + else if (NestedDescriptorAction is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + } + else if (NestedValue is not null) + { + writer.WritePropertyName("nested"); + JsonSerializer.Serialize(writer, NestedValue, options); + } + + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SearchStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SearchStats.g.cs new file mode 100644 index 00000000000..713db7ba8f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SearchStats.g.cs @@ -0,0 +1,68 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class SearchStats +{ + [JsonInclude, JsonPropertyName("fetch_current")] + public long FetchCurrent { get; init; } + [JsonInclude, JsonPropertyName("fetch_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? FetchTime { get; init; } + [JsonInclude, JsonPropertyName("fetch_time_in_millis")] + public long FetchTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("fetch_total")] + public long FetchTotal { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyDictionary? Groups { get; init; } + [JsonInclude, JsonPropertyName("open_contexts")] + public long? OpenContexts { get; init; } + [JsonInclude, JsonPropertyName("query_current")] + public long QueryCurrent { get; init; } + [JsonInclude, JsonPropertyName("query_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? QueryTime { get; init; } + [JsonInclude, JsonPropertyName("query_time_in_millis")] + public long QueryTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("query_total")] + public long QueryTotal { get; init; } + [JsonInclude, JsonPropertyName("scroll_current")] + public long ScrollCurrent { get; init; } + [JsonInclude, JsonPropertyName("scroll_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ScrollTime { get; init; } + [JsonInclude, JsonPropertyName("scroll_time_in_millis")] + public long ScrollTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("scroll_total")] + public long ScrollTotal { get; init; } + [JsonInclude, JsonPropertyName("suggest_current")] + public long SuggestCurrent { get; init; } + [JsonInclude, JsonPropertyName("suggest_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? SuggestTime { get; init; } + [JsonInclude, JsonPropertyName("suggest_time_in_millis")] + public long SuggestTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("suggest_total")] + public long SuggestTotal { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs new file mode 100644 index 00000000000..a84e56411b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs @@ -0,0 +1,167 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class SegmentsStats +{ + /// + /// Total number of segments across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Total amount of memory used for doc values across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("doc_values_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? DocValuesMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("doc_values_memory_in_bytes")] + public long DocValuesMemoryInBytes { get; init; } + + /// + /// This object is not populated by the cluster stats API.
To get information on segment files, use the node stats API.
+ ///
+ [JsonInclude, JsonPropertyName("file_sizes")] + public IReadOnlyDictionary FileSizes { get; init; } + + /// + /// Total amount of memory used by fixed bit sets across all shards assigned to selected nodes.
Fixed bit sets are used for nested object field types and type filters for join fields.
+ ///
+ [JsonInclude, JsonPropertyName("fixed_bit_set")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? FixedBitSet { get; init; } + + /// + /// Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("fixed_bit_set_memory_in_bytes")] + public long FixedBitSetMemoryInBytes { get; init; } + [JsonInclude, JsonPropertyName("index_writer_max_memory_in_bytes")] + public long? IndexWriterMaxMemoryInBytes { get; init; } + + /// + /// Total amount of memory used by all index writers across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("index_writer_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? IndexWriterMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("index_writer_memory_in_bytes")] + public long IndexWriterMemoryInBytes { get; init; } + + /// + /// Unix timestamp, in milliseconds, of the most recently retried indexing request. + /// + [JsonInclude, JsonPropertyName("max_unsafe_auto_id_timestamp")] + public long MaxUnsafeAutoIdTimestamp { get; init; } + + /// + /// Total amount of memory used for segments across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Memory { get; init; } + + /// + /// Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("memory_in_bytes")] + public long MemoryInBytes { get; init; } + + /// + /// Total amount of memory used for normalization factors across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("norms_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? NormsMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("norms_memory_in_bytes")] + public long NormsMemoryInBytes { get; init; } + + /// + /// Total amount of memory used for points across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("points_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? PointsMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used for points across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("points_memory_in_bytes")] + public long PointsMemoryInBytes { get; init; } + + /// + /// Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("stored_fields_memory_in_bytes")] + public long StoredFieldsMemoryInBytes { get; init; } + [JsonInclude, JsonPropertyName("stored_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? StoredMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("term_vectors_memory_in_bytes")] + public long TermVectorsMemoryInBytes { get; init; } + + /// + /// Total amount of memory used for term vectors across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("term_vectory_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TermVectoryMemory { get; init; } + + /// + /// Total amount of memory used for terms across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("terms_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TermsMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("terms_memory_in_bytes")] + public long TermsMemoryInBytes { get; init; } + + /// + /// Total amount of memory used by all version maps across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("version_map_memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? VersionMapMemory { get; init; } + + /// + /// Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("version_map_memory_in_bytes")] + public long VersionMapMemoryInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardFailure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardFailure.g.cs new file mode 100644 index 00000000000..c97cc06dc85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardFailure.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ShardFailure +{ + [JsonInclude, JsonPropertyName("index")] + public string? Index { get; init; } + [JsonInclude, JsonPropertyName("node")] + public string? Node { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Reason { get; init; } + [JsonInclude, JsonPropertyName("shard")] + public int Shard { get; init; } + [JsonInclude, JsonPropertyName("status")] + public string? Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardStatistics.g.cs new file mode 100644 index 00000000000..79cf3f79949 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ShardStatistics.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class ShardStatistics +{ + [JsonInclude, JsonPropertyName("failed")] + public int Failed { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("skipped")] + public int? Skipped { get; init; } + + /// + /// Indicates how many shards have successfully run the search. + /// + [JsonInclude, JsonPropertyName("successful")] + public int Successful { get; init; } + + /// + /// Indicates how many shards the search will run on overall. + /// + [JsonInclude, JsonPropertyName("total")] + public int Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs new file mode 100644 index 00000000000..3511c28334f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs @@ -0,0 +1,150 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class SlicedScroll +{ + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + [JsonInclude, JsonPropertyName("max")] + public int Max { get; set; } +} + +public sealed partial class SlicedScrollDescriptor : SerializableDescriptor> +{ + internal SlicedScrollDescriptor(Action> configure) => configure.Invoke(this); + + public SlicedScrollDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private int MaxValue { get; set; } + + public SlicedScrollDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public SlicedScrollDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SlicedScrollDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public SlicedScrollDescriptor Max(int max) + { + MaxValue = max; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("max"); + writer.WriteNumberValue(MaxValue); + writer.WriteEndObject(); + } +} + +public sealed partial class SlicedScrollDescriptor : SerializableDescriptor +{ + internal SlicedScrollDescriptor(Action configure) => configure.Invoke(this); + + public SlicedScrollDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private int MaxValue { get; set; } + + public SlicedScrollDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + public SlicedScrollDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SlicedScrollDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SlicedScrollDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public SlicedScrollDescriptor Max(int max) + { + MaxValue = max; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + writer.WritePropertyName("max"); + writer.WriteNumberValue(MaxValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs new file mode 100644 index 00000000000..faac2f0f666 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class Slices : Union +{ + public Slices(int value) : base(value) + { + } + + public Slices(Elastic.Clients.Elasticsearch.Serverless.SlicesCalculation computed) : base(computed) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SortOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SortOptions.g.cs new file mode 100644 index 00000000000..1ffdf611674 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SortOptions.g.cs @@ -0,0 +1,296 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +[JsonConverter(typeof(SortOptionsConverter))] +public sealed partial class SortOptions +{ + internal SortOptions(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal SortOptions(Elastic.Clients.Elasticsearch.Serverless.Field field, object variant) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + AdditionalPropertyName = field; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + internal Elastic.Clients.Elasticsearch.Serverless.Field? AdditionalPropertyName { get; } + + public static SortOptions Doc(Elastic.Clients.Elasticsearch.Serverless.ScoreSort scoreSort) => new SortOptions("_doc", scoreSort); + public static SortOptions GeoDistance(Elastic.Clients.Elasticsearch.Serverless.GeoDistanceSort geoDistanceSort) => new SortOptions("_geo_distance", geoDistanceSort); + public static SortOptions Score(Elastic.Clients.Elasticsearch.Serverless.ScoreSort scoreSort) => new SortOptions("_score", scoreSort); + public static SortOptions Script(Elastic.Clients.Elasticsearch.Serverless.ScriptSort scriptSort) => new SortOptions("_script", scriptSort); + public static SortOptions Field(Elastic.Clients.Elasticsearch.Serverless.Field field, Elastic.Clients.Elasticsearch.Serverless.FieldSort fieldSort) => new SortOptions(field, fieldSort); +} + +public sealed partial class SortOptionsDescriptor : SerializableDescriptor> +{ + internal SortOptionsDescriptor(Action> configure) => configure.Invoke(this); + + public SortOptionsDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field AdditionalPropertyName { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldSort AdditionalPropertyValue { get; set; } + + private SortOptionsDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + AdditionalPropertyValue = null; + AdditionalPropertyName = null; + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SortOptionsDescriptor Set(object variant, string variantName) + { + AdditionalPropertyValue = null; + AdditionalPropertyName = null; + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private SortOptionsDescriptor Set(Action descriptorAction, Elastic.Clients.Elasticsearch.Serverless.Field variantName) where T : Descriptor + { + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + ContainedVariantName = null; + Variant = null; + AdditionalPropertyValue = null; + AdditionalPropertyName = variantName; + ContainsVariant = true; + return Self; + } + + private SortOptionsDescriptor Set(Elastic.Clients.Elasticsearch.Serverless.FieldSort variant, Elastic.Clients.Elasticsearch.Serverless.Field variantName) + { + ContainedVariantName = null; + Variant = null; + AdditionalPropertyValue = variant; + AdditionalPropertyName = variantName; + ContainsVariant = true; + return Self; + } + + public SortOptionsDescriptor Doc(ScoreSort scoreSort) => Set(scoreSort, "_doc"); + public SortOptionsDescriptor Doc(Action configure) => Set(configure, "_doc"); + public SortOptionsDescriptor GeoDistance(GeoDistanceSort geoDistanceSort) => Set(geoDistanceSort, "_geo_distance"); + public SortOptionsDescriptor GeoDistance(Action> configure) => Set(configure, "_geo_distance"); + public SortOptionsDescriptor Score(ScoreSort scoreSort) => Set(scoreSort, "_score"); + public SortOptionsDescriptor Score(Action configure) => Set(configure, "_score"); + public SortOptionsDescriptor Script(ScriptSort scriptSort) => Set(scriptSort, "_script"); + public SortOptionsDescriptor Script(Action> configure) => Set(configure, "_script"); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) => Set(FieldSort.Empty, field); + public SortOptionsDescriptor Field(Expression> field) => Set(FieldSort.Empty, field); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field, Elastic.Clients.Elasticsearch.Serverless.FieldSort sort) => Set(sort, field); + public SortOptionsDescriptor Field(Expression> field, Elastic.Clients.Elasticsearch.Serverless.FieldSort sort) => Set(sort, field); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field, Action> configure) => Set(configure, field); + public SortOptionsDescriptor Field(Expression> field, Action> configure) => Set(configure, field); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + var fieldName = ContainedVariantName; + if (AdditionalPropertyName is IUrlParameter urlParameter) + { + fieldName = urlParameter.GetString(settings); + } + + if ((Variant is not null && Variant.Equals(FieldSort.Empty)) || (AdditionalPropertyValue is not null && AdditionalPropertyValue.Equals(FieldSort.Empty))) + { + writer.WriteStringValue(fieldName); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(fieldName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + if (AdditionalPropertyValue is not null) + { + JsonSerializer.Serialize(writer, AdditionalPropertyValue, options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class SortOptionsDescriptor : SerializableDescriptor +{ + internal SortOptionsDescriptor(Action configure) => configure.Invoke(this); + + public SortOptionsDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field AdditionalPropertyName { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldSort AdditionalPropertyValue { get; set; } + + private SortOptionsDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + AdditionalPropertyValue = null; + AdditionalPropertyName = null; + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SortOptionsDescriptor Set(object variant, string variantName) + { + AdditionalPropertyValue = null; + AdditionalPropertyName = null; + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private SortOptionsDescriptor Set(Action descriptorAction, Elastic.Clients.Elasticsearch.Serverless.Field variantName) where T : Descriptor + { + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + ContainedVariantName = null; + Variant = null; + AdditionalPropertyValue = null; + AdditionalPropertyName = variantName; + ContainsVariant = true; + return Self; + } + + private SortOptionsDescriptor Set(Elastic.Clients.Elasticsearch.Serverless.FieldSort variant, Elastic.Clients.Elasticsearch.Serverless.Field variantName) + { + ContainedVariantName = null; + Variant = null; + AdditionalPropertyValue = variant; + AdditionalPropertyName = variantName; + ContainsVariant = true; + return Self; + } + + public SortOptionsDescriptor Doc(ScoreSort scoreSort) => Set(scoreSort, "_doc"); + public SortOptionsDescriptor Doc(Action configure) => Set(configure, "_doc"); + public SortOptionsDescriptor GeoDistance(GeoDistanceSort geoDistanceSort) => Set(geoDistanceSort, "_geo_distance"); + public SortOptionsDescriptor GeoDistance(Action configure) => Set(configure, "_geo_distance"); + public SortOptionsDescriptor GeoDistance(Action> configure) => Set(configure, "_geo_distance"); + public SortOptionsDescriptor Score(ScoreSort scoreSort) => Set(scoreSort, "_score"); + public SortOptionsDescriptor Score(Action configure) => Set(configure, "_score"); + public SortOptionsDescriptor Script(ScriptSort scriptSort) => Set(scriptSort, "_script"); + public SortOptionsDescriptor Script(Action configure) => Set(configure, "_script"); + public SortOptionsDescriptor Script(Action> configure) => Set(configure, "_script"); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) => Set(FieldSort.Empty, field); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field, Elastic.Clients.Elasticsearch.Serverless.FieldSort sort) => Set(sort, field); + public SortOptionsDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field, Action configure) => Set(configure, field); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + var fieldName = ContainedVariantName; + if (AdditionalPropertyName is IUrlParameter urlParameter) + { + fieldName = urlParameter.GetString(settings); + } + + if ((Variant is not null && Variant.Equals(FieldSort.Empty)) || (AdditionalPropertyValue is not null && AdditionalPropertyValue.Equals(FieldSort.Empty))) + { + writer.WriteStringValue(fieldName); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(fieldName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + if (AdditionalPropertyValue is not null) + { + JsonSerializer.Serialize(writer, AdditionalPropertyValue, options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs new file mode 100644 index 00000000000..cd200bf6592 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +internal sealed class StopWordsConverter : SingleOrManyCollectionConverter +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoreStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoreStats.g.cs new file mode 100644 index 00000000000..d8fb6efa6b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoreStats.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class StoreStats +{ + /// + /// A prediction of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities. + /// + [JsonInclude, JsonPropertyName("reserved")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Reserved { get; init; } + + /// + /// A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities. + /// + [JsonInclude, JsonPropertyName("reserved_in_bytes")] + public long ReservedInBytes { get; init; } + + /// + /// Total size of all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Size { get; init; } + + /// + /// Total size, in bytes, of all shards assigned to selected nodes. + /// + [JsonInclude, JsonPropertyName("size_in_bytes")] + public long SizeInBytes { get; init; } + + /// + /// Total data set size of all shards assigned to selected nodes.
This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
+ ///
+ [JsonInclude, JsonPropertyName("total_data_set_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalDataSetSize { get; init; } + + /// + /// Total data set size, in bytes, of all shards assigned to selected nodes.
This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
+ ///
+ [JsonInclude, JsonPropertyName("total_data_set_size_in_bytes")] + public long? TotalDataSetSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScript.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScript.g.cs new file mode 100644 index 00000000000..a4580720f86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScript.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class StoredScript +{ + /// + /// Specifies the language the script is written in. + /// + [JsonInclude, JsonPropertyName("lang")] + public Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage Language { get; set; } + [JsonInclude, JsonPropertyName("options")] + public IDictionary? Options { get; set; } + + /// + /// The script source. + /// + [JsonInclude, JsonPropertyName("source")] + public string Source { get; set; } +} + +public sealed partial class StoredScriptDescriptor : SerializableDescriptor +{ + internal StoredScriptDescriptor(Action configure) => configure.Invoke(this); + + public StoredScriptDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage LanguageValue { get; set; } + private IDictionary? OptionsValue { get; set; } + private string SourceValue { get; set; } + + /// + /// Specifies the language the script is written in. + /// + public StoredScriptDescriptor Language(Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage language) + { + LanguageValue = language; + return Self; + } + + public StoredScriptDescriptor Options(Func, FluentDictionary> selector) + { + OptionsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The script source. + /// + public StoredScriptDescriptor Source(string source) + { + SourceValue = source; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("lang"); + JsonSerializer.Serialize(writer, LanguageValue, options); + if (OptionsValue is not null) + { + writer.WritePropertyName("options"); + JsonSerializer.Serialize(writer, OptionsValue, options); + } + + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs new file mode 100644 index 00000000000..e04d8fb2f18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class StoredScriptId +{ + /// + /// The `id` for a stored script. + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } +} + +public sealed partial class StoredScriptIdDescriptor : SerializableDescriptor +{ + internal StoredScriptIdDescriptor(Action configure) => configure.Invoke(this); + + public StoredScriptIdDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } + private IDictionary? ParamsValue { get; set; } + + /// + /// The `id` for a stored script. + /// + public StoredScriptIdDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + IdValue = id; + return Self; + } + + public StoredScriptIdDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, options); + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfo.g.cs new file mode 100644 index 00000000000..6dffbfe329e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfo.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Tasks; + +public sealed partial class TaskInfo +{ + [JsonInclude, JsonPropertyName("action")] + public string Action { get; init; } + [JsonInclude, JsonPropertyName("cancellable")] + public bool Cancellable { get; init; } + [JsonInclude, JsonPropertyName("cancelled")] + public bool? Cancelled { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("headers")] + public IReadOnlyDictionary Headers { get; init; } + [JsonInclude, JsonPropertyName("id")] + public long Id { get; init; } + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("parent_task_id")] + public Elastic.Clients.Elasticsearch.Serverless.TaskId? ParentTaskId { get; init; } + [JsonInclude, JsonPropertyName("running_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? RunningTime { get; init; } + [JsonInclude, JsonPropertyName("running_time_in_nanos")] + public long RunningTimeInNanos { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } + + /// + /// Task status information can vary wildly from task to task. + /// + [JsonInclude, JsonPropertyName("status")] + public object? Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs new file mode 100644 index 00000000000..46db556692a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TextEmbedding +{ + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; set; } + [JsonInclude, JsonPropertyName("model_text")] + public string ModelText { get; set; } + + public static implicit operator QueryVectorBuilder(TextEmbedding textEmbedding) => QueryVectorBuilder.TextEmbedding(textEmbedding); +} + +public sealed partial class TextEmbeddingDescriptor : SerializableDescriptor +{ + internal TextEmbeddingDescriptor(Action configure) => configure.Invoke(this); + + public TextEmbeddingDescriptor() : base() + { + } + + private string ModelIdValue { get; set; } + private string ModelTextValue { get; set; } + + public TextEmbeddingDescriptor ModelId(string modelId) + { + ModelIdValue = modelId; + return Self; + } + + public TextEmbeddingDescriptor ModelText(string modelText) + { + ModelTextValue = modelText; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("model_id"); + writer.WriteStringValue(ModelIdValue); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(ModelTextValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs new file mode 100644 index 00000000000..802fede7de5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs @@ -0,0 +1,70 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TopLeftBottomRightGeoBounds +{ + [JsonInclude, JsonPropertyName("bottom_right")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomRight { get; set; } + [JsonInclude, JsonPropertyName("top_left")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopLeft { get; set; } +} + +public sealed partial class TopLeftBottomRightGeoBoundsDescriptor : SerializableDescriptor +{ + internal TopLeftBottomRightGeoBoundsDescriptor(Action configure) => configure.Invoke(this); + + public TopLeftBottomRightGeoBoundsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomRightValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopLeftValue { get; set; } + + public TopLeftBottomRightGeoBoundsDescriptor BottomRight(Elastic.Clients.Elasticsearch.Serverless.GeoLocation bottomRight) + { + BottomRightValue = bottomRight; + return Self; + } + + public TopLeftBottomRightGeoBoundsDescriptor TopLeft(Elastic.Clients.Elasticsearch.Serverless.GeoLocation topLeft) + { + TopLeftValue = topLeft; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bottom_right"); + JsonSerializer.Serialize(writer, BottomRightValue, options); + writer.WritePropertyName("top_left"); + JsonSerializer.Serialize(writer, TopLeftValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs new file mode 100644 index 00000000000..b36239edcfb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs @@ -0,0 +1,70 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TopRightBottomLeftGeoBounds +{ + [JsonInclude, JsonPropertyName("bottom_left")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomLeft { get; set; } + [JsonInclude, JsonPropertyName("top_right")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopRight { get; set; } +} + +public sealed partial class TopRightBottomLeftGeoBoundsDescriptor : SerializableDescriptor +{ + internal TopRightBottomLeftGeoBoundsDescriptor(Action configure) => configure.Invoke(this); + + public TopRightBottomLeftGeoBoundsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomLeftValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopRightValue { get; set; } + + public TopRightBottomLeftGeoBoundsDescriptor BottomLeft(Elastic.Clients.Elasticsearch.Serverless.GeoLocation bottomLeft) + { + BottomLeftValue = bottomLeft; + return Self; + } + + public TopRightBottomLeftGeoBoundsDescriptor TopRight(Elastic.Clients.Elasticsearch.Serverless.GeoLocation topRight) + { + TopRightValue = topRight; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("bottom_left"); + JsonSerializer.Serialize(writer, BottomLeftValue, options); + writer.WritePropertyName("top_right"); + JsonSerializer.Serialize(writer, TopRightValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs new file mode 100644 index 00000000000..aa28c12c2b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs @@ -0,0 +1,255 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +[JsonConverter(typeof(PivotGroupByConverter))] +public sealed partial class PivotGroupBy +{ + internal PivotGroupBy(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static PivotGroupBy DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => new PivotGroupBy("date_histogram", dateHistogramAggregation); + public static PivotGroupBy GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => new PivotGroupBy("geotile_grid", geotileGridAggregation); + public static PivotGroupBy Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => new PivotGroupBy("histogram", histogramAggregation); + public static PivotGroupBy Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation termsAggregation) => new PivotGroupBy("terms", termsAggregation); +} + +internal sealed partial class PivotGroupByConverter : JsonConverter +{ + public override PivotGroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + reader.Read(); + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the variant held within this container."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "date_histogram") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new PivotGroupBy(propertyName, variant); + } + + if (propertyName == "geotile_grid") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new PivotGroupBy(propertyName, variant); + } + + if (propertyName == "histogram") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new PivotGroupBy(propertyName, variant); + } + + if (propertyName == "terms") + { + var variant = JsonSerializer.Deserialize(ref reader, options); + reader.Read(); + return new PivotGroupBy(propertyName, variant); + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, PivotGroupBy value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null & value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "date_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation)value.Variant, options); + break; + case "geotile_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation)value.Variant, options); + break; + case "histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation)value.Variant, options); + break; + case "terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PivotGroupByDescriptor : SerializableDescriptor> +{ + internal PivotGroupByDescriptor(Action> configure) => configure.Invoke(this); + + public PivotGroupByDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PivotGroupByDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private PivotGroupByDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PivotGroupByDescriptor DateHistogram(Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public PivotGroupByDescriptor Terms(Action> configure) => Set(configure, "terms"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} + +public sealed partial class PivotGroupByDescriptor : SerializableDescriptor +{ + internal PivotGroupByDescriptor(Action configure) => configure.Invoke(this); + + public PivotGroupByDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PivotGroupByDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private PivotGroupByDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PivotGroupByDescriptor DateHistogram(Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public PivotGroupByDescriptor Terms(Action configure) => Set(configure, "terms"); + public PivotGroupByDescriptor Terms(Action> configure) => Set(configure, "terms"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (!ContainsVariant) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TranslogStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TranslogStats.g.cs new file mode 100644 index 00000000000..93916b748cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TranslogStats.g.cs @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class TranslogStats +{ + [JsonInclude, JsonPropertyName("earliest_last_modified_age")] + public long EarliestLastModifiedAge { get; init; } + [JsonInclude, JsonPropertyName("operations")] + public long Operations { get; init; } + [JsonInclude, JsonPropertyName("size")] + public string? Size { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public long SizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("uncommitted_operations")] + public int UncommittedOperations { get; init; } + [JsonInclude, JsonPropertyName("uncommitted_size")] + public string? UncommittedSize { get; init; } + [JsonInclude, JsonPropertyName("uncommitted_size_in_bytes")] + public long UncommittedSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WarmerStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WarmerStats.g.cs new file mode 100644 index 00000000000..e928884a331 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WarmerStats.g.cs @@ -0,0 +1,40 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class WarmerStats +{ + [JsonInclude, JsonPropertyName("current")] + public long Current { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WktGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WktGeoBounds.g.cs new file mode 100644 index 00000000000..3c7d254b5e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/WktGeoBounds.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class WktGeoBounds +{ + [JsonInclude, JsonPropertyName("wkt")] + public string Wkt { get; set; } +} + +public sealed partial class WktGeoBoundsDescriptor : SerializableDescriptor +{ + internal WktGeoBoundsDescriptor(Action configure) => configure.Invoke(this); + + public WktGeoBoundsDescriptor() : base() + { + } + + private string WktValue { get; set; } + + public WktGeoBoundsDescriptor Wkt(string wkt) + { + WktValue = wkt; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("wkt"); + writer.WriteStringValue(WktValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json b/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json new file mode 100644 index 00000000000..667780aba72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json @@ -0,0 +1,942 @@ +{ + "version": 1, + "dependencies": { + ".NETCoreApp,Version=v3.1": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Text.Json": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + } + }, + ".NETFramework,Version=v4.6.1": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Text.Json": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.ValueTuple": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" + } + }, + ".NETStandard,Version=v2.0": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Text.Json": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + } + }, + ".NETStandard,Version=v2.1": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Text.Json": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + } + }, + ".NETCoreApp,Version=v5.0": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Text.Json": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + } + }, + "net6.0": { + "ConfigureAwaitChecker.Analyzer": { + "type": "Direct", + "requested": "[5.0.0.1, )", + "resolved": "5.0.0.1", + "contentHash": "jqOPPOJzHiUajPVGNw0MJzqUYLM3nHYEXEo1X91VqbwBqvq0+u8ASgcdmlmr4E9ffWJkjIo8vPEH9EMrKh69EQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==" + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Direct", + "requested": "[17.3.44, )", + "resolved": "17.3.44", + "contentHash": "96TPV4lH1a8iXNoq6sQxSTAXXCewyt2bE7luIZd3kS7Zzs1fs6Uwd9bFg2AxBt1WNPU1ozb3D1olpsoRmLKleA==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + } + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/GetAsyncSearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/GetAsyncSearchRequest.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/GetAsyncSearchRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/GetAsyncSearchRequest.cs index 0df7e6e5abe..f2f73c8857d 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/GetAsyncSearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/GetAsyncSearchRequest.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; +#else namespace Elastic.Clients.Elasticsearch.AsyncSearch; +#endif public partial class GetAsyncSearchRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/SubmitAsyncSearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/SubmitAsyncSearchRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs index 1292afaead1..01292530f14 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/AsyncSearch/SubmitAsyncSearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else using Elastic.Clients.Elasticsearch.QueryDsl; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; +#else namespace Elastic.Clients.Elasticsearch.AsyncSearch; +#endif public partial class SubmitAsyncSearchRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/BulkRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/BulkRequest.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Api/BulkRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/BulkRequest.cs index 9918407c49d..b9a2bf5151e 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/BulkRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/BulkRequest.cs @@ -8,11 +8,27 @@ using System.IO; using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Requests; +#else using Elastic.Clients.Elasticsearch.Requests; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class BulkRequest : IStreamSerializable { diff --git a/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/BulkResponse.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/BulkResponse.cs index 10780cbce97..d5fd6d808f3 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/BulkResponse.cs @@ -6,9 +6,17 @@ using System.Text.Json.Serialization; using System.Text; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class BulkResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/CountRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/CountRequest.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Api/CountRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/CountRequest.cs index 63dcddab77c..208739a25d6 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/CountRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/CountRequest.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else using Elastic.Clients.Elasticsearch.QueryDsl; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed partial class CountRequest : CountRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/CreateRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/CreateRequest.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch/Api/CreateRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/CreateRequest.cs index f2b80e97a09..b2d68e979e0 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/CreateRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/CreateRequest.cs @@ -2,11 +2,19 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed partial class CreateRequest : ICustomJsonWriter { diff --git a/src/Elastic.Clients.Elasticsearch/Api/DeleteRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/DeleteRequest.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Api/DeleteRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/DeleteRequest.cs index c2a6e9ceb67..f1b209d2706 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/DeleteRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/DeleteRequest.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed partial class DeleteRequest : DeleteRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/Eql/EqlGetResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Eql/EqlGetResponse.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Api/Eql/EqlGetResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/Eql/EqlGetResponse.cs index 3b168ded56f..7074fc78b8d 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/Eql/EqlGetResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Eql/EqlGetResponse.cs @@ -2,6 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +// TODO: Move away from shared project + +#if !ELASTICSEARCH_SERVERLESS + using System.Collections.Generic; using System.Text.Json.Serialization; @@ -24,3 +28,5 @@ public partial class EqlGetResponse [JsonIgnore] public long Total => Hits?.Total.Value ?? -1; } + +#endif diff --git a/src/Elastic.Clients.Elasticsearch/Api/ExistsRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/ExistsRequest.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Api/ExistsRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/ExistsRequest.cs index abb03eb618c..ff6b53bf5eb 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/ExistsRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/ExistsRequest.cs @@ -7,7 +7,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class ExistsRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/GetSourceRequestDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceRequestDescriptor.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Api/GetSourceRequestDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceRequestDescriptor.cs index 9c284eac810..d862790031d 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/GetSourceRequestDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceRequestDescriptor.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class GetSourceRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Api/GetSourceResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceResponse.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Api/GetSourceResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceResponse.cs index 96cfa23efe7..3cc2eb06a73 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/GetSourceResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceResponse.cs @@ -4,9 +4,17 @@ using System.Text.Json; using System.IO; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class GetSourceResponse : ISelfDeserializable { diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetAliasResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetAliasResponse.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetAliasResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetAliasResponse.cs index d0a3fdcd288..0bbc5b5b3f3 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetAliasResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetAliasResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +#else namespace Elastic.Clients.Elasticsearch.IndexManagement; +#endif public partial class GetAliasResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetFieldMappingResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetFieldMappingResponse.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetFieldMappingResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetFieldMappingResponse.cs index 06cf61bb266..9734623b3d1 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetFieldMappingResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetFieldMappingResponse.cs @@ -2,6 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +// TODO: Move away from shared project + +#if !ELASTICSEARCH_SERVERLESS + using System; using System.Collections.Generic; using System.Linq.Expressions; @@ -90,3 +94,5 @@ private IReadOnlyDictionary MappingsFor(IndexName index) return indexMapping.Mappings; } } + +#endif diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetIndexResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetIndexResponse.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetIndexResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetIndexResponse.cs index 9b33d1544fd..ebb9409beae 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetIndexResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetIndexResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +#else namespace Elastic.Clients.Elasticsearch.IndexManagement; +#endif public partial class GetIndexResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetMappingResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetMappingResponse.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetMappingResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetMappingResponse.cs index bfe6ac31e30..383346b5da4 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetMappingResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetMappingResponse.cs @@ -4,9 +4,17 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else using Elastic.Clients.Elasticsearch.Mapping; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +#else namespace Elastic.Clients.Elasticsearch.IndexManagement; +#endif public partial class GetMappingResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetTemplateResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetTemplateResponse.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetTemplateResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetTemplateResponse.cs index bc09793b8ad..b73a4f1aeea 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexManagement/GetTemplateResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetTemplateResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +#else namespace Elastic.Clients.Elasticsearch.IndexManagement; +#endif public partial class GetTemplateResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/IndexRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Api/IndexRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs index 6f4c01cda15..867ec3653bb 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/IndexRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs @@ -4,11 +4,23 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Requests; +#else using Elastic.Clients.Elasticsearch.Requests; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class IndexRequest : ICustomJsonWriter { diff --git a/src/Elastic.Clients.Elasticsearch/Api/Ingest/GetPipelineResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/GetPipelineResponse.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Api/Ingest/GetPipelineResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/GetPipelineResponse.cs index 22c85ee1f72..4f9bf0a7259 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/Ingest/GetPipelineResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/GetPipelineResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; +#else namespace Elastic.Clients.Elasticsearch.Ingest; +#endif public partial class GetPipelineResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/Ingest/Processor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Api/Ingest/Processor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs index 76f2091d5c2..867e1374031 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/Ingest/Processor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs @@ -4,7 +4,11 @@ using System.Diagnostics.CodeAnalysis; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; +#else namespace Elastic.Clients.Elasticsearch.Ingest; +#endif public partial class Processor { diff --git a/src/Elastic.Clients.Elasticsearch/Api/MultiSearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/MultiSearchRequest.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Api/MultiSearchRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/MultiSearchRequest.cs index c7fc45a28af..067e83ec882 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/MultiSearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/MultiSearchRequest.cs @@ -5,7 +5,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class MultiSearchResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/ResponseItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/ResponseItem.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Api/ResponseItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/ResponseItem.cs index f43dd53ef29..893c62831a7 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/ResponseItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/ResponseItem.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public abstract partial class ResponseItem { diff --git a/src/Elastic.Clients.Elasticsearch/Api/ScrollResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Api/ScrollResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs index fbf43da382d..4095b35931e 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/ScrollResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class ScrollResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/SearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Api/SearchRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs index 344bae20ab8..8d3694f7209 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/SearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs @@ -4,9 +4,17 @@ using System; using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Requests; +#else using Elastic.Clients.Elasticsearch.Requests; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class SearchRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Api/SearchResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchResponse.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Api/SearchResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/SearchResponse.cs index c438a763706..7d22d89fef4 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/SearchResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchResponse.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class SearchResponse { @@ -18,4 +22,4 @@ public partial class SearchResponse [JsonIgnore] public long Total => HitsMetadata?.Total?.Value ?? -1; -} +} diff --git a/src/Elastic.Clients.Elasticsearch/Api/Sql/GetAsyncResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/GetAsyncResponse.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Api/Sql/GetAsyncResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/GetAsyncResponse.cs index 0ef4200ceb6..f6437b688f3 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/Sql/GetAsyncResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/GetAsyncResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Sql; +#else namespace Elastic.Clients.Elasticsearch.Sql; +#endif public partial class GetAsyncResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Api/Sql/QueryResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/QueryResponse.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Api/Sql/QueryResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/QueryResponse.cs index b8b0f77dbc3..e441429bfb9 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/Sql/QueryResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/QueryResponse.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Sql; +#else namespace Elastic.Clients.Elasticsearch.Sql; +#endif public partial class QueryResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-BulkAll.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-BulkAll.cs similarity index 59% rename from src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-BulkAll.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-BulkAll.cs index 149cfe48e0c..c1d02427932 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-BulkAll.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-BulkAll.cs @@ -2,6 +2,8 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if !ELASTICSEARCH_SERVERLESS + using System; using System.Collections.Generic; using System.Threading; @@ -11,12 +13,14 @@ namespace Elastic.Clients.Elasticsearch; public partial class ElasticsearchClient { public virtual BulkAllObservable BulkAll(IEnumerable documents, Action> configure, CancellationToken cancellationToken = default) - { - var descriptor = new BulkAllRequestDescriptor(documents); - configure?.Invoke(descriptor); - return BulkAll(descriptor, cancellationToken); - } + { + var descriptor = new BulkAllRequestDescriptor(documents); + configure?.Invoke(descriptor); + return BulkAll(descriptor, cancellationToken); + } - public virtual BulkAllObservable BulkAll(IBulkAllRequest request, CancellationToken cancellationToken = default) => - new(this, request, cancellationToken); + public virtual BulkAllObservable BulkAll(IBulkAllRequest request, CancellationToken cancellationToken = default) => + new(this, request, cancellationToken); } + +#endif diff --git a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-Manual.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-Manual.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs index 3131c09b1ac..4dbf619cd61 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient-Manual.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs @@ -6,7 +6,11 @@ using System.Threading.Tasks; using System.Threading; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class ElasticsearchClient { diff --git a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchResponseBaseExtensions.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchResponseBaseExtensions.cs index aca4334e42a..bde69cf5f81 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchResponseBaseExtensions.cs @@ -4,7 +4,11 @@ using Elastic.Transport.Products.Elasticsearch; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public static class ElasticsearchResponseExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Client/IndexManyExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndexManyExtensions.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Client/IndexManyExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/IndexManyExtensions.cs index f9dc6a5b95b..60eda486156 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/IndexManyExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndexManyExtensions.cs @@ -6,9 +6,17 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Provides GetMany extensions that make it easier to get many documents given a list of ids diff --git a/src/Elastic.Clients.Elasticsearch/Client/IndicesNamespace.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Client/IndicesNamespace.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs index c665931e12f..ee1917f77ef 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/IndicesNamespace.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs @@ -2,6 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +// TODO: Move away from shared project + +#if !ELASTICSEARCH_SERVERLESS + using System.Threading.Tasks; using System.Threading; using System; @@ -12,7 +16,7 @@ public partial class IndicesNamespacedClient { /// /// Refresh one or more indices. A refresh makes recent operations performed on one or more indices available for search. For data streams, - /// the API runs the refresh operation on the stream’s backing indices. + /// the API runs the refresh operation on the stream’s backing indices. /// /// The index and/or data streams to refresh. /// A from the server. @@ -25,7 +29,7 @@ public RefreshResponse Refresh(Indices indices) /// /// Refresh one or more indices. A refresh makes recent operations performed on one or more indices available for search. For data streams, - /// the API runs the refresh operation on the stream’s backing indices. + /// the API runs the refresh operation on the stream’s backing indices. /// /// The index and/or data streams to refresh. /// A used to cancel the asynchronous operation. @@ -53,3 +57,5 @@ public virtual Task GetAliasAsync(Indices indicies, Action(descriptor, cancellationToken); } } + +#endif diff --git a/src/Elastic.Clients.Elasticsearch/Client/NamespacedClientProxy.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Client/NamespacedClientProxy.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs index 6e953b03fae..1e34e7b0d43 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/NamespacedClientProxy.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs @@ -5,11 +5,19 @@ using System; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Requests; +#else using Elastic.Clients.Elasticsearch.Requests; +#endif using Elastic.Transport; using Elastic.Transport.Products.Elasticsearch; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public abstract class NamespacedClientProxy { @@ -17,7 +25,7 @@ public abstract class NamespacedClientProxy "new instance of ElasticsearchClient to perform requests over a network to Elasticsearch."; private readonly ElasticsearchClient _client; - + /// /// Initializes a new instance for mocking. /// diff --git a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationCombinator.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationCombinator.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs index 5340fd730f4..30499672923 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationCombinator.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif /// /// Combines aggregations into a single list of aggregations. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs index 99cfa3c731a..a047001e7f8 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif /// /// Describes aggregations to execute as part of a search. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/IAggregate.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/Core/Aggregations/IAggregate.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs index 8bd38d481ee..2145bdec1af 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/IAggregate.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs @@ -2,6 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public interface IAggregate { } diff --git a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/SearchAggregation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Aggregations/SearchAggregation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs index 2dee8a6ff54..bcff4eb0522 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Aggregations/SearchAggregation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif // This is marked as internal for now, until we are ready to support plugin aggregations. internal interface ISearchAggregation diff --git a/src/Elastic.Clients.Elasticsearch/Core/Configuration/ClrTypeDefaults.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ClrTypeDefaults.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Configuration/ClrTypeDefaults.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ClrTypeDefaults.cs index 18759b25600..c5f6b858a00 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Configuration/ClrTypeDefaults.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ClrTypeDefaults.cs @@ -4,9 +4,17 @@ using System; using System.Linq.Expressions; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public class ClrTypeMapping { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Configuration/ElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Configuration/ElasticsearchClientSettings.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs index d54e7f0b50a..455d5dfa569 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Configuration/ElasticsearchClientSettings.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/ElasticsearchClientSettings.cs @@ -8,13 +8,25 @@ using System.Linq; using System.Linq.Expressions; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; using Elastic.Transport.Products; using Elastic.Transport.Products.Elasticsearch; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// public class ElasticsearchClientSettings : ElasticsearchClientSettingsBase @@ -172,7 +184,7 @@ public TConnectionSettings DefaultFieldNameInferrer(Func fieldNa { dss.Options.PropertyNamingPolicy = new CustomizedNamingPolicy(fieldNameInferrer); } - + return Assign>(fieldNameInferrer, (a, v) => a._defaultFieldNameInferrer = v); } diff --git a/src/Elastic.Clients.Elasticsearch/Core/Configuration/IElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/IElasticsearchClientSettings.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Configuration/IElasticsearchClientSettings.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/IElasticsearchClientSettings.cs index 5f480534fe5..070b7ebb27a 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Configuration/IElasticsearchClientSettings.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/IElasticsearchClientSettings.cs @@ -5,10 +5,18 @@ using System; using System.Collections.Generic; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Provides the connection settings for Elastic.Clients.Elasticsearch's high level diff --git a/src/Elastic.Clients.Elasticsearch/Core/Configuration/MemberInfoResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/MemberInfoResolver.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Configuration/MemberInfoResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/MemberInfoResolver.cs index e1401c4f9e1..04dcf8806d0 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Configuration/MemberInfoResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Configuration/MemberInfoResolver.cs @@ -6,7 +6,11 @@ using System.Linq.Expressions; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Resolves member infos in an expression, instance may NOT be shared. diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMath.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMath.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMath.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMath.cs index c30cefac3c5..05c5217b0ad 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMath.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMath.cs @@ -10,7 +10,11 @@ using System.Text.Json.Serialization; using System.Text.RegularExpressions; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(DateMathConverter))] public abstract class DateMath @@ -167,7 +171,7 @@ internal sealed class DateMathConverter : JsonConverter // TODO: Performance - Review potential to avoid allocation on DateTime path and use Span - var value = reader.GetString(); + var value = reader.GetString(); reader.Read(); if (!value.Contains("|") && DateTime.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var dateTime)) @@ -182,7 +186,7 @@ public override void Write(Utf8JsonWriter writer, DateMath value, JsonSerializer { writer.WriteNullValue(); return; - } + } writer.WriteStringValue(value.ToString()); } diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathExpression.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathExpression.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathExpression.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathExpression.cs index bac070f3404..8c62e942c12 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathExpression.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathExpression.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(DateMathExpressionConverter))] public class DateMathExpression : DateMath diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathOperation.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathOperation.cs index 97b6443ae32..c98daed1077 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathOperation.cs @@ -6,9 +6,17 @@ using System.Runtime.Serialization; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [StringEnum] [JsonConverter(typeof(DateMathOperationConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTime.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTime.cs similarity index 99% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTime.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTime.cs index ba472b8fbe3..b04d6a4884c 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTime.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTime.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using System.Text.RegularExpressions; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// A time representation for use within expressions. diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTimeUnit.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTimeUnit.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTimeUnit.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTimeUnit.cs index 424df43497b..8efa78ff0e8 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTimeUnit.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/DateMath/DateMathTimeUnit.cs @@ -6,9 +6,17 @@ using System.Runtime.Serialization; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [StringEnum] [JsonConverter(typeof(DateMathTimeUnitConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/Duration.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/Duration.cs similarity index 99% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/Duration.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/Duration.cs index c419e74112d..aff9c726056 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/Duration.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/Duration.cs @@ -9,7 +9,11 @@ using System.Text.RegularExpressions; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents a duration value. diff --git a/src/Elastic.Clients.Elasticsearch/Core/DateTime/TimeUnit.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/TimeUnit.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/DateTime/TimeUnit.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/TimeUnit.cs index bb14adbe488..830a0c2a6a2 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/DateTime/TimeUnit.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/DateTime/TimeUnit.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public static class TimeUnitExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnly.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnly.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnly.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnly.cs index 4c315cc8ec8..0ff1f98b165 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnly.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnly.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class EmptyReadOnly { diff --git a/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnlyExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnlyExtensions.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnlyExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnlyExtensions.cs index 516e97be6c3..df41d8091f5 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnlyExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/EmptyReadOnlyExtensions.cs @@ -6,7 +6,11 @@ using System.Collections.ObjectModel; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class EmptyReadOnlyExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Exceptions/ThrowHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Exceptions/ThrowHelper.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Exceptions/ThrowHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Exceptions/ThrowHelper.cs index 0f3376692d8..881592d3e73 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Exceptions/ThrowHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Exceptions/ThrowHelper.cs @@ -7,7 +7,11 @@ using System.Runtime.CompilerServices; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class ThrowHelper { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExceptionExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExceptionExtensions.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/ExceptionExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExceptionExtensions.cs index 9bea6600ff0..687beed1811 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExceptionExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExceptionExtensions.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class ExceptionExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExpressionExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExpressionExtensions.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/ExpressionExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExpressionExtensions.cs index c95b207f3c8..5e4c2c494e5 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExpressionExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/ExpressionExtensions.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Linq.Expressions; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public static class ExpressionExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/Extensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/Extensions.cs similarity index 99% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/Extensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/Extensions.cs index fb8fe3d900f..52e3a14c5d1 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/Extensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/Extensions.cs @@ -13,7 +13,11 @@ using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class Extensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/StringExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/StringExtensions.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/StringExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/StringExtensions.cs index a281af466d7..68b0b6290c6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/StringExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/StringExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class StringExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/SuffixExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/SuffixExtensions.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/SuffixExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/SuffixExtensions.cs index 2fe7f90222a..7d4e661ce1d 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/SuffixExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/SuffixExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public static class SuffixExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/TaskExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TaskExtensions.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/TaskExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TaskExtensions.cs index 0b740fd82ab..dcff3fbf155 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/TaskExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TaskExtensions.cs @@ -10,7 +10,11 @@ using System.Diagnostics; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class TaskExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Extensions/TypeExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TypeExtensions.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Extensions/TypeExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TypeExtensions.cs index 331b4ed39c0..432cfce1908 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Extensions/TypeExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Extensions/TypeExtensions.cs @@ -10,7 +10,11 @@ using System.Reflection; using System.Text; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class TypeExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValue.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValue.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValue.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValue.cs index 1d3172f5313..9ebf95304eb 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValue.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValue.cs @@ -8,9 +8,17 @@ using System.Diagnostics.CodeAnalysis; using System.Collections.Generic; using System.Globalization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents a value for a field which depends on the field mapping and is only known at runtime, diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValues.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValues.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValues.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValues.cs index cf2ef28ec16..affeca53609 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValues.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fields/FieldValues.cs @@ -8,9 +8,17 @@ using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(FieldValuesConverter))] public sealed class FieldValues : IsADictionary diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Descriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Descriptor.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/Descriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Descriptor.cs index becbd038927..d6fb61d5560 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Descriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Descriptor.cs @@ -8,9 +8,17 @@ using System.Runtime.Serialization; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif public abstract class Descriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Fluent.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Fluent.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/Fluent.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Fluent.cs index c3d9572a920..4383a8c9704 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Fluent.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Fluent.cs @@ -5,7 +5,11 @@ using System; using System.Runtime.CompilerServices; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif internal static class FluentAssign { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/FluentDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/FluentDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs index 7258083d1f4..3fc4c17c581 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/FluentDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs @@ -4,7 +4,11 @@ using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif /// /// Used in the "fluent" syntax to support chained configuration of dictionary entries. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/IBuildableDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/IBuildableDescriptor.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/IBuildableDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/IBuildableDescriptor.cs index 697f243ae5a..6d4c47cc9ed 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/IBuildableDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/IBuildableDescriptor.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif /// /// Used to mark descriptors which can be used to build the object they describe. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IPromise.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IPromise.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IPromise.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IPromise.cs index 2f467d0347a..b4e4438a344 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IPromise.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IPromise.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif internal interface IPromise where TValue : class { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IsADictionaryDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IsADictionaryDescriptor.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IsADictionaryDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IsADictionaryDescriptor.cs index f6b5ac2b798..09d8a241725 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IsADictionaryDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/IsADictionaryDescriptor.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif public abstract class IsADictionaryDescriptor : PromiseDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/PromiseDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/PromiseDescriptor.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/PromiseDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/PromiseDescriptor.cs index 7eefb2578f5..c2f4ce2fa47 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/PromiseDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/Promise/PromiseDescriptor.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else namespace Elastic.Clients.Elasticsearch.Fluent; +#endif public abstract class PromiseDescriptor : Descriptor, IPromise where TDescriptor : PromiseDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/Core/IComplexUnion.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/IComplexUnion.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch/Core/IComplexUnion.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/IComplexUnion.cs index 5f8e77b8826..678b6ed05d9 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/IComplexUnion.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/IComplexUnion.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core; +#else namespace Elastic.Clients.Elasticsearch.Core; +#endif internal interface IComplexUnion where TEnum : Enum { diff --git a/src/Elastic.Clients.Elasticsearch/Core/IEnumStruct.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/IEnumStruct.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Core/IEnumStruct.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/IEnumStruct.cs index 0fc170344fe..06ec5d57b8a 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/IEnumStruct.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/IEnumStruct.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core; +#else namespace Elastic.Clients.Elasticsearch.Core; +#endif internal interface IEnumStruct where TSelf : struct, IEnumStruct { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/DefaultPropertyMappingProvider.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DefaultPropertyMappingProvider.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/DefaultPropertyMappingProvider.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DefaultPropertyMappingProvider.cs index 434f54e30ad..48401f5d47f 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/DefaultPropertyMappingProvider.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DefaultPropertyMappingProvider.cs @@ -6,7 +6,11 @@ using System.Reflection; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// public class DefaultPropertyMappingProvider : IPropertyMappingProvider diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/DocumentPath/DocumentPath.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DocumentPath/DocumentPath.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/DocumentPath/DocumentPath.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DocumentPath/DocumentPath.cs index 30daca886a1..ce4f7b3dd77 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/DocumentPath/DocumentPath.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/DocumentPath/DocumentPath.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif // MARKED INTERNAL AS WE MAY NO LONGER USE THIS TYPE // TODO - REVIEW THIS @@ -18,7 +22,11 @@ internal interface IDocumentPath // TODO - REVIEW THIS internal sealed class DocumentPath : IEquatable>, IDocumentPath { +#if ELASTICSEARCH_SERVERLESS + public DocumentPath(T document) : this(Elasticsearch.Serverless.Id.From(document)) => Document = document; +#else public DocumentPath(T document) : this(Elasticsearch.Id.From(document)) => Document = document; +#endif public DocumentPath(Id id) { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/Field.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/Field.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/Field.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/Field.cs index dbbf247862a..3075cbc7219 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/Field.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/Field.cs @@ -10,7 +10,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(FieldConverter))] [DebuggerDisplay("{" + nameof(DebugDisplay) + ",nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldConverter.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldConverter.cs index 43cfededc56..3269e0143e3 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldConverter.cs @@ -5,10 +5,18 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class FieldConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExpressionVisitor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExpressionVisitor.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExpressionVisitor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExpressionVisitor.cs index 237ec3a2a80..f9b202fe880 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExpressionVisitor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExpressionVisitor.cs @@ -11,7 +11,11 @@ using System.Text; using System.Collections; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal class FieldExpressionVisitor : ExpressionVisitor { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExtensions.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExtensions.cs index 8752441d6ef..68f7b260972 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif //internal static class FieldExtensions //{ // internal static bool IsConditionless(this Field field) => diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldResolver.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldResolver.cs index 82b17ff3f3a..c0dc6f65aa8 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/FieldResolver.cs @@ -8,7 +8,11 @@ using System.Globalization; using System.Linq.Expressions; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal class FieldResolver { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/ToStringExpressionVisitor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/ToStringExpressionVisitor.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Field/ToStringExpressionVisitor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/ToStringExpressionVisitor.cs index a84cc653f6e..cc4f09d81a7 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/ToStringExpressionVisitor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Field/ToStringExpressionVisitor.cs @@ -11,7 +11,11 @@ using System.Runtime.CompilerServices; using System.Text; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal class ToStringExpressionVisitor : ExpressionVisitor { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/Fields.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/Fields.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/Fields.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/Fields.cs index fae971124c4..840c6563ef6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/Fields.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/Fields.cs @@ -13,7 +13,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(FieldsConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsConverter.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsConverter.cs index 1b517ff2457..1788f8d1e1a 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class FieldsConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsDescriptor.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsDescriptor.cs index a7eb3d5b8ba..c9c353833d1 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Fields/FieldsDescriptor.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif //public class FieldsDescriptor : DescriptorPromiseBase, Fields> // where T : class //{ diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/IPropertyMappingProvider.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IPropertyMappingProvider.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/IPropertyMappingProvider.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IPropertyMappingProvider.cs index 27d4b0e6bb1..2f75e613fcd 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/IPropertyMappingProvider.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IPropertyMappingProvider.cs @@ -4,7 +4,11 @@ using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Provides mappings for CLR types. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Id.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Id.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Id.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Id.cs index 1adab333a9e..aabd32c7c23 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Id.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Id.cs @@ -9,7 +9,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] [JsonConverter(typeof(IdConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdConverter.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdConverter.cs index 4e4781092d8..03294d94ff9 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdConverter.cs @@ -5,10 +5,18 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class IdConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdExtensions.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdExtensions.cs index b246a83173f..ea4f36499de 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif //internal static class IdExtensions //{ // internal static bool IsConditionless(this Id id) => diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdResolver.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdResolver.cs index 7994d96e599..a52f871a209 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdResolver.cs @@ -6,7 +6,11 @@ using System.Collections.Concurrent; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public class IdResolver { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Ids.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Ids.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Ids.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Ids.cs index 118d1119d96..7e2fe48daf0 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Ids.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/Ids.cs @@ -9,7 +9,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] [JsonConverter(typeof(IdsConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdsConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdsConverter.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdsConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdsConverter.cs index 0fcada2b2fc..5e9da65b3fc 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdsConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Id/IdsConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class IdsConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexName.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexName.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexName.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexName.cs index 9109432ffa2..ddbf28ac5d6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexName.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexName.cs @@ -7,7 +7,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents the name of an index, which may be inferred from a . diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameConverter.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameConverter.cs index 675f04d48a5..d42f354bc9e 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameConverter.cs @@ -5,10 +5,18 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Converts an to and from its JSON representation. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameExtensions.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameExtensions.cs index 44075fc9d6e..cfb09b3828d 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif //public static class IndexNameExtensions //{ // public static string? Resolve(this IndexName? marker, IElasticsearchClientSettings elasticsearchClientSettings) diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameResolver.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameResolver.cs index 82526235753..65aa393a66e 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/IndexName/IndexNameResolver.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal class IndexNameResolver { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Indices/Indices.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Indices/Indices.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Indices/Indices.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Indices/Indices.cs index 8134c97b8ba..86a96c56df5 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Indices/Indices.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Indices/Indices.cs @@ -9,10 +9,18 @@ using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] [JsonConverter(typeof(IndicesJsonConverter))] @@ -109,7 +117,7 @@ string IUrlParameter.GetString(ITransportConfiguration? settings) var value = inferrer.IndexName(_indices.First()); return value; } - + var indices = _indices.Select(i => inferrer.IndexName(i)); return string.Join(",", indices); } diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Inferrer.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Inferrer.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Inferrer.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Inferrer.cs index 4d5c459660f..d98c695df67 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Inferrer.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Inferrer.cs @@ -5,7 +5,11 @@ using System; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class Inferrer { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinField.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinField.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/JoinField.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinField.cs index d3b791c999a..bd18619542b 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinField.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinField.cs @@ -5,7 +5,11 @@ using System; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(JoinFieldConverter))] public class JoinField diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldConverter.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldConverter.cs index 7aff28193fd..f7ac5d2221c 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldConverter.cs @@ -6,10 +6,18 @@ using System.Text.Json.Serialization; using System.Text.Json; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using System.Runtime; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class JoinFieldConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/Routing.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/Routing.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/Routing.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/Routing.cs index f88d48eb558..024545157a6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/Routing.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/Routing.cs @@ -10,7 +10,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(RoutingConverter))] [DebuggerDisplay("{" + nameof(DebugDisplay) + ",nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/RoutingConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/RoutingConverter.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/RoutingConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/RoutingConverter.cs index 1691211f273..7a475f18f23 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/RoutingConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/JoinFieldRouting/RoutingConverter.cs @@ -5,9 +5,17 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class RoutingConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Metric/Metrics.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Metric/Metrics.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Metric/Metrics.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Metric/Metrics.cs index 68cc21015f3..279a4221c1d 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Metric/Metrics.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Metric/Metrics.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents a collection of unique metric names to be included in URL paths to limit the request. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyMapping.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyMapping.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyMapping.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyMapping.cs index 3292fe6cdb6..5e0051b5516 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyMapping.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyMapping.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents meta data about a property which may be used by inferrence and during serialization. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyName.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyName.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyName.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyName.cs index 8399241d5b4..cdf3a03d1e7 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyName.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyName.cs @@ -7,10 +7,18 @@ using System.Linq.Expressions; using System.Reflection; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{" + nameof(DebugDisplay) + ",nq}")] [JsonConverter(typeof(PropertyNameConverter))] @@ -39,7 +47,7 @@ public PropertyName(PropertyInfo property) _comparisonValue = property; _type = property.DeclaringType; } - + public bool CacheableExpression { get; } public Expression Expression { get; } diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyNameExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyNameExtensions.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyNameExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyNameExtensions.cs index e24e1559818..ba572b2a680 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyNameExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/PropertyName/PropertyNameExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif //internal static class PropertyNameExtensions //{ // internal static bool IsConditionless(this PropertyName property) => diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationName.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationName.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationName.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationName.cs index 7808bed02b4..ce4dc4ad35d 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationName.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationName.cs @@ -6,9 +6,17 @@ using Elastic.Transport; using System.Text.Json.Serialization; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(RelationNameConverter))] public sealed class RelationName : IEquatable, IUrlParameter diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationNameResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationNameResolver.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationNameResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationNameResolver.cs index d14ed4c4344..1da804f368f 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationNameResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RelationName/RelationNameResolver.cs @@ -5,7 +5,11 @@ using System; using System.Collections.Concurrent; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal sealed class RelationNameResolver { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/RoutingResolver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RoutingResolver.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/RoutingResolver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RoutingResolver.cs index dac444251ac..838523def95 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/RoutingResolver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/RoutingResolver.cs @@ -7,7 +7,11 @@ using System.Reflection; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public class RoutingResolver { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Infer/Timestamp/Timestamp.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Timestamp/Timestamp.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Infer/Timestamp/Timestamp.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Timestamp/Timestamp.cs index 921f39a66d4..289e223bff6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Infer/Timestamp/Timestamp.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Infer/Timestamp/Timestamp.cs @@ -6,7 +6,11 @@ using System.Globalization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class Timestamp : IUrlParameter, IEquatable { diff --git a/src/Elastic.Clients.Elasticsearch/Core/IsADictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/IsADictionary.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/IsADictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/IsADictionary.cs index 3afb7a0a598..3347c55f910 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/IsADictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/IsADictionary.cs @@ -8,7 +8,11 @@ using System.ComponentModel; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public interface IIsADictionary { } diff --git a/src/Elastic.Clients.Elasticsearch/Core/IsAReadOnlyDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/IsAReadOnlyDictionary.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/IsAReadOnlyDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/IsAReadOnlyDictionary.cs index 3921e5ed085..8bdc1d9f65b 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/IsAReadOnlyDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/IsAReadOnlyDictionary.cs @@ -5,7 +5,11 @@ using System.Collections; using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public interface IIsAReadOnlyDictionary { } diff --git a/src/Elastic.Clients.Elasticsearch/Core/LazyJson.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/LazyJson.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/LazyJson.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/LazyJson.cs index 6a231c9a501..5e57d9ae070 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/LazyJson.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/LazyJson.cs @@ -5,9 +5,17 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Lazily deserializable JSON. diff --git a/src/Elastic.Clients.Elasticsearch/Core/MinimumShouldMatch.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/MinimumShouldMatch.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/MinimumShouldMatch.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/MinimumShouldMatch.cs index b8a954eff2e..ae1fb1f6ee6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/MinimumShouldMatch.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/MinimumShouldMatch.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class MinimumShouldMatch : Union { diff --git a/src/Elastic.Clients.Elasticsearch/Core/OpenTelemetry/SemanticConventions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/OpenTelemetry/SemanticConventions.cs similarity index 76% rename from src/Elastic.Clients.Elasticsearch/Core/OpenTelemetry/SemanticConventions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/OpenTelemetry/SemanticConventions.cs index afc1d7437cb..2f7cce8386c 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/OpenTelemetry/SemanticConventions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/OpenTelemetry/SemanticConventions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.OpenTelemetry; +#else namespace Elastic.Clients.Elasticsearch.OpenTelemetry; +#endif internal static class SemanticConventions { diff --git a/src/Elastic.Clients.Elasticsearch/Core/RawJsonString.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/RawJsonString.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/RawJsonString.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/RawJsonString.cs index e8b1a6d5aac..9c6fd54591e 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/RawJsonString.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/RawJsonString.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif #if NET6_0_OR_GREATER public struct RawJsonString diff --git a/src/Elastic.Clients.Elasticsearch/Core/ReadOnlyFieldDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyFieldDictionary.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/ReadOnlyFieldDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyFieldDictionary.cs index 018f0e82c46..c75f89e23f0 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/ReadOnlyFieldDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyFieldDictionary.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// A specialised readonly dictionary for data, keyed by . diff --git a/src/Elastic.Clients.Elasticsearch/Core/ReadOnlyIndexNameDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyIndexNameDictionary.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/ReadOnlyIndexNameDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyIndexNameDictionary.cs index e0e254f0906..74a8155d6ab 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/ReadOnlyIndexNameDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/ReadOnlyIndexNameDictionary.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// A specialised readonly dictionary for data, keyed by . diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/ApiUrls.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/ApiUrls.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Request/ApiUrls.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/ApiUrls.cs index f2e3b8a8a3e..4cd324be8cd 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/ApiUrls.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/ApiUrls.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif /// /// Each Request type holds a static instance of this class which creates cached builders for each diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/PlainRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/PlainRequest.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/Request/PlainRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/PlainRequest.cs index abe99a6e4f9..ea8c67aded5 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/PlainRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/PlainRequest.cs @@ -6,7 +6,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif public abstract class PlainRequest : Request where TParameters : RequestParameters, new() diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/Request.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/Request.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/Request/Request.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/Request.cs index 928f3f26e34..adb0ba6ea57 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/Request.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/Request.cs @@ -8,7 +8,11 @@ using Elastic.Transport; using Elastic.Transport.Diagnostics; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif /// /// Base type for requests sent by the client. @@ -24,7 +28,7 @@ internal Request() { } internal virtual string? ContentType { get; } = null; /// - /// The default HTTP method for the request which is based on the Elasticsearch Specification endpoint definition. + /// The default HTTP method for the request which is based on the Elasticsearch Specification endpoint definition. /// [JsonIgnore] protected abstract HttpMethod StaticHttpMethod { get; } @@ -75,7 +79,7 @@ protected Request(Func pathSelector) } [JsonIgnore] internal TParameters RequestParameters => _parameters; - + protected TOut Q(string name) => RequestParameters.GetQueryStringValue(name); protected void Q(string name, object value) => RequestParameters.SetQueryString(name, value); diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/RequestDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RequestDescriptor.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/Request/RequestDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RequestDescriptor.cs index 65b236b4a60..2fd99ba8f23 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/RequestDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RequestDescriptor.cs @@ -5,10 +5,18 @@ using System; using System.ComponentModel; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif /// /// Base class for all request descriptor types. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/RouteValues.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/Request/RouteValues.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs index 39bdd9498d3..86d148c7594 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/RouteValues.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif internal sealed class ResolvedRouteValues : Dictionary { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Request/UrlLookup.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/UrlLookup.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/Request/UrlLookup.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Request/UrlLookup.cs index 55e2f8f4624..a250290d1e8 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Request/UrlLookup.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/UrlLookup.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Requests; +#else namespace Elastic.Clients.Elasticsearch.Requests; +#endif internal class UrlLookup { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Response/DictionaryResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Response/DictionaryResponse.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/Response/DictionaryResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Response/DictionaryResponse.cs index 59f02f392f7..1ad8146c5c6 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Response/DictionaryResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Response/DictionaryResponse.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using Elastic.Transport.Products.Elasticsearch; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public abstract class DictionaryResponse : ElasticsearchResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Core/Response/ResolvableDictionaryProxy.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Response/ResolvableDictionaryProxy.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Response/ResolvableDictionaryProxy.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Response/ResolvableDictionaryProxy.cs index 1edc6924b3f..0a90cbba2ed 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Response/ResolvableDictionaryProxy.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Response/ResolvableDictionaryProxy.cs @@ -6,7 +6,11 @@ using System.Collections; using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// A proxy dictionary that is settings-aware to correctly handle IUrlParameter-based keys such as IndexName. diff --git a/src/Elastic.Clients.Elasticsearch/Core/Static/Infer.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Static/Infer.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Core/Static/Infer.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Static/Infer.cs index 15b320e96e7..400b7238b02 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Static/Infer.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Static/Infer.cs @@ -8,7 +8,11 @@ using System.Linq.Expressions; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public static class Infer { @@ -40,7 +44,11 @@ public static class Infer public static Names Names(IEnumerable names) => string.Join(",", names); +#if ELASTICSEARCH_SERVERLESS + public static Id Id(T document) where T : class => Elasticsearch.Serverless.Id.From(document); +#else public static Id Id(T document) where T : class => Elasticsearch.Id.From(document); +#endif public static Fields Fields(params Expression>[] fields) where T : class => new(fields.Select(f => new Field(f))); diff --git a/src/Elastic.Clients.Elasticsearch/Core/Union/Union.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Union/Union.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/Union/Union.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/Union/Union.cs index 95fcf32d3a8..7245632274b 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/Union/Union.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Union/Union.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Represents the union of two types, and . Used diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamName.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamName.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamName.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamName.cs index 45de4980f85..217d2b8bb50 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamName.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamName.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(DataStreamNameConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamNames.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamNames.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamNames.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamNames.cs index 3753699c9c4..c7eb0bff77c 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamNames.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/DataStreamNames/DataStreamNames.cs @@ -11,7 +11,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(DataStreamNamesConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexAlias/IndexAlias.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexAlias/IndexAlias.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexAlias/IndexAlias.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexAlias/IndexAlias.cs index cf11c50cb3b..565bc674ddb 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexAlias/IndexAlias.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexAlias/IndexAlias.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(IndexAliasConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexUuid/IndexUuid.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexUuid/IndexUuid.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexUuid/IndexUuid.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexUuid/IndexUuid.cs index 5a29dbec53c..a7341ae6e3f 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexUuid/IndexUuid.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/IndexUuid/IndexUuid.cs @@ -5,7 +5,11 @@ using System; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class IndexUuid : IUrlParameter, IEquatable { diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Name.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Name.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Name.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Name.cs index 906d3e34c38..cd2b68acb0a 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Name.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Name.cs @@ -5,10 +5,18 @@ using System; using System.Diagnostics; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] [JsonConverter(typeof(StringAliasConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Names.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Names.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Names.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Names.cs index f86a078d477..a66545cbf07 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Names.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Name/Names.cs @@ -8,7 +8,11 @@ using System.Linq; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] public sealed class Names : IEquatable, IUrlParameter diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/NodeIds/NodeIds.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/NodeIds/NodeIds.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/NodeIds/NodeIds.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/NodeIds/NodeIds.cs index eb02c1e2fce..91095fd814e 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/NodeIds/NodeIds.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/NodeIds/NodeIds.cs @@ -8,7 +8,11 @@ using System.Linq; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] public sealed class NodeIds : IEquatable, IUrlParameter diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollId.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollId.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollId.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollId.cs index a7f26e6469e..f8eee29cc64 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollId.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollId.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(ScrollIdConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollIds.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollIds.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollIds.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollIds.cs index d0b2cfaa4a8..2beb5475f10 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollIds.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/ScrollIds/ScrollIds.cs @@ -11,7 +11,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(ScrollIdsConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/TaskId/TaskId.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/TaskId/TaskId.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/TaskId/TaskId.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/TaskId/TaskId.cs index 107e8da4cdb..e5a3eaad137 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/TaskId/TaskId.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/TaskId/TaskId.cs @@ -7,10 +7,18 @@ using System.Globalization; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(TaskIdConverter))] [DebuggerDisplay("{DebugDisplay,nq}")] diff --git a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Username/Username.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Username/Username.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Username/Username.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Username/Username.cs index 65f8b734471..93d41f39dd3 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Username/Username.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/UrlParameters/Username/Username.cs @@ -5,10 +5,18 @@ using System; using System.Diagnostics; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [DebuggerDisplay("{DebugDisplay,nq}")] [JsonConverter(typeof(StringAliasConverter))] diff --git a/src/Elastic.Clients.Elasticsearch/CrossPlatform/IsExternalInit.cs b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/IsExternalInit.cs similarity index 100% rename from src/Elastic.Clients.Elasticsearch/CrossPlatform/IsExternalInit.cs rename to src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/IsExternalInit.cs diff --git a/src/Elastic.Clients.Elasticsearch/CrossPlatform/NativeMethods.cs b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/NativeMethods.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/CrossPlatform/NativeMethods.cs rename to src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/NativeMethods.cs index 665237fc284..3c9def509f3 100644 --- a/src/Elastic.Clients.Elasticsearch/CrossPlatform/NativeMethods.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/NativeMethods.cs @@ -9,7 +9,11 @@ using System.Runtime.InteropServices; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class NativeMethods { diff --git a/src/Elastic.Clients.Elasticsearch/CrossPlatform/NullableAttributes.cs b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/NullableAttributes.cs similarity index 100% rename from src/Elastic.Clients.Elasticsearch/CrossPlatform/NullableAttributes.cs rename to src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/NullableAttributes.cs diff --git a/src/Elastic.Clients.Elasticsearch/CrossPlatform/RuntimeInformation.cs b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/RuntimeInformation.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/CrossPlatform/RuntimeInformation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/RuntimeInformation.cs index 488262a3f45..e7893241f88 100644 --- a/src/Elastic.Clients.Elasticsearch/CrossPlatform/RuntimeInformation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/RuntimeInformation.cs @@ -7,7 +7,11 @@ using System.Linq; using System.Reflection; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless +#else namespace Elastic.Clients.Elasticsearch +#endif { internal static class RuntimeInformation { diff --git a/src/Elastic.Clients.Elasticsearch/CrossPlatform/TypeExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/TypeExtensions.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/CrossPlatform/TypeExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/TypeExtensions.cs index 61cdbf2d2bc..eeba6465023 100644 --- a/src/Elastic.Clients.Elasticsearch/CrossPlatform/TypeExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/CrossPlatform/TypeExtensions.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class DotNetCoreTypeExtensions { diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.projitems b/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.projitems new file mode 100644 index 00000000000..c80a96ccde6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.projitems @@ -0,0 +1,14 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + a90dd7b8-8afb-4be9-aa16-b159a880e79d + + + Elastic.Clients.Elasticsearch.Shared + + + + + \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.shproj b/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.shproj new file mode 100644 index 00000000000..031926721c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Shared/Elastic.Clients.Elasticsearch.Shared.shproj @@ -0,0 +1,13 @@ + + + + a90dd7b8-8afb-4be9-aa16-b159a880e79d + 14.0 + + + + + + + + diff --git a/src/Elastic.Clients.Elasticsearch/Exceptions/UnsupportedProductException.cs b/src/Elastic.Clients.Elasticsearch.Shared/Exceptions/UnsupportedProductException.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Exceptions/UnsupportedProductException.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Exceptions/UnsupportedProductException.cs index 720106de74b..df4fd46e68e 100644 --- a/src/Elastic.Clients.Elasticsearch/Exceptions/UnsupportedProductException.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Exceptions/UnsupportedProductException.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// Thrown when the client pre-flight check determines that the server is not a supported Elasticsearch product. diff --git a/src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs index 675f22f2572..22516b75146 100644 --- a/src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs @@ -2,11 +2,19 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else using Elastic.Clients.Elasticsearch.Aggregations; +#endif using System; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Experimental; +#else namespace Elastic.Clients.Elasticsearch.Experimental; +#endif internal static class AggregateDictionaryExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BlockingSubscribeExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BlockingSubscribeExtensions.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Helpers/BlockingSubscribeExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/BlockingSubscribeExtensions.cs index b7d0b8838b4..6b1fc986a9d 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BlockingSubscribeExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BlockingSubscribeExtensions.cs @@ -2,10 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if !ELASTICSEARCH_SERVERLESS using System; using System.Threading; - namespace Elastic.Clients.Elasticsearch; public static class BlockingSubscribeExtensions @@ -43,3 +43,5 @@ Func, Action, TObserver> factory return observer; } } + +#endif diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObservable.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObservable.cs new file mode 100644 index 00000000000..5718539fe1e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObservable.cs @@ -0,0 +1,299 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +#if !ELASTICSEARCH_SERVERLESS + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Elastic.Transport; +using Elastic.Transport.Diagnostics.Auditing; +using Elastic.Transport.Extensions; +using Elastic.Transport.Products.Elasticsearch; +using Elastic.Clients.Elasticsearch.Core.Bulk; +using Elastic.Clients.Elasticsearch.Requests; + +namespace Elastic.Clients.Elasticsearch; + +public sealed class BulkAllObservable : IDisposable, IObservable +{ + private bool _disposedValue; + + private readonly int _backOffRetries; + private readonly TimeSpan _backOffTime; + private readonly int _bulkSize; + private readonly ElasticsearchClient _client; + + private readonly CancellationToken _compositeCancelToken; + private readonly CancellationTokenSource _compositeCancelTokenSource; + private readonly Action _droppedDocumentCallBack; + private readonly int _maxDegreeOfParallelism; + private readonly IBulkAllRequest _partitionedBulkRequest; + private readonly Func _retryPredicate; + + private readonly Action _incrementFailed = () => { }; + private readonly Action _incrementRetries = () => { }; + + private readonly Action _bulkResponseCallback; + + public BulkAllObservable(ElasticsearchClient client, IBulkAllRequest partitionedBulkRequest, CancellationToken cancellationToken = default) + { + _client = client; + _partitionedBulkRequest = partitionedBulkRequest; + _backOffRetries = _partitionedBulkRequest.BackOffRetries.GetValueOrDefault(CoordinatedRequestDefaults.BulkAllBackOffRetriesDefault); + _backOffTime = _partitionedBulkRequest?.BackOffTime?.ToTimeSpan() ?? CoordinatedRequestDefaults.BulkAllBackOffTimeDefault; + _bulkSize = _partitionedBulkRequest.Size ?? CoordinatedRequestDefaults.BulkAllSizeDefault; + _retryPredicate = _partitionedBulkRequest.RetryDocumentPredicate ?? RetryBulkActionPredicate; + _droppedDocumentCallBack = _partitionedBulkRequest.DroppedDocumentCallback ?? DroppedDocumentCallbackDefault; + _bulkResponseCallback = _partitionedBulkRequest.BulkResponseCallback; + _maxDegreeOfParallelism = _partitionedBulkRequest.MaxDegreeOfParallelism ?? CoordinatedRequestDefaults.BulkAllMaxDegreeOfParallelismDefault; + _compositeCancelTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + _compositeCancelToken = _compositeCancelTokenSource.Token; + } + + private void BulkAll(IObserver observer) + { + var documents = _partitionedBulkRequest.Documents; + var partitioned = new PartitionHelper(documents, _bulkSize); +#pragma warning disable 4014 +#pragma warning disable VSTHRD110 // Observe result of async calls + partitioned.ForEachAsync( +#pragma warning restore 4014 + (buffer, page) => BulkAsync(buffer, page, 0), + (buffer, response) => observer.OnNext(response), + ex => OnCompleted(ex, observer), + _maxDegreeOfParallelism + ); +#pragma warning restore VSTHRD110 // Observe result of async calls + } + + private void OnCompleted(Exception exception, IObserver observer) + { + if (exception != null) + observer.OnError(exception); + else + { + try + { + RefreshOnCompleted(); + observer.OnCompleted(); + } + catch (Exception e) + { + observer.OnError(e); + } + } + } + + private void RefreshOnCompleted() + { + if (!_partitionedBulkRequest.RefreshOnCompleted) + return; + + var indices = _partitionedBulkRequest.RefreshIndices ?? _partitionedBulkRequest.Index; + if (indices == null) + return; + + var rc = _partitionedBulkRequest switch + { + IHelperCallable helperCallable when helperCallable.ParentMetaData is not null => helperCallable.ParentMetaData, + _ => RequestMetaDataFactory.BulkHelperRequestMetaData(), + }; + + var request = new IndexManagement.RefreshRequest(indices); + + if (rc is not null) + request.RequestConfiguration = new RequestConfiguration { RequestMetaData = rc }; + + var refresh = _client.Indices.Refresh(request); + + if (!refresh.IsValidResponse) + throw Throw($"Refreshing after all documents have indexed failed", refresh); + } + + private async Task BulkAsync(IList buffer, long page, int backOffRetries) + { + _compositeCancelToken.ThrowIfCancellationRequested(); + + var request = _partitionedBulkRequest; + + var response = await _client.BulkAsync(s => + { + s.RequestParameters.RequestConfiguration = new RequestConfiguration { DisableAuditTrail = false }; + s.Index(request.Index); + s.Timeout(request.Timeout); + + if (request.BufferToBulk is not null) + { + request.BufferToBulk(s, buffer); + } + else + { + s.IndexMany(buffer); + } + + if (!string.IsNullOrEmpty(request.Pipeline)) + s.Pipeline(request.Pipeline); + if (request.Routing != null) + s.Routing(request.Routing); + if (request.WaitForActiveShards.HasValue) + s.WaitForActiveShards(request.WaitForActiveShards.ToString()); + + switch (_partitionedBulkRequest) + { + case IHelperCallable helperCallable when helperCallable.ParentMetaData is not null: + s.RequestConfiguration(rc => rc.RequestMetaData(helperCallable.ParentMetaData)); + break; + default: + s.RequestConfiguration(rc => rc.RequestMetaData(RequestMetaDataFactory.BulkHelperRequestMetaData())); + break; + } + + }, _compositeCancelToken).ConfigureAwait(false); + + _compositeCancelToken.ThrowIfCancellationRequested(); + _bulkResponseCallback?.Invoke(response); + + if (!response.ApiCallDetails.HasSuccessfulStatusCode || !response.ApiCallDetails.HasExpectedContentType) + return await HandleBulkRequestAsync(buffer, page, backOffRetries, response).ConfigureAwait(false); + + var retryableDocuments = new List(); + var droppedDocuments = new List>(); + + var retryableDocsRemainingAfterRetriesExceeded = false; + + foreach (var documentWithResponse in response.Items.Zip(buffer, Tuple.Create)) + { + if (documentWithResponse.Item1.IsValid) + continue; + + if (_retryPredicate(documentWithResponse.Item1, documentWithResponse.Item2)) + { + if (backOffRetries < _backOffRetries) + { + retryableDocuments.Add(documentWithResponse.Item2); + } + else + { + // We still have retriable documents but have exceeded all retries, so we mark these as + // dropped so they get handled correctly. + retryableDocsRemainingAfterRetriesExceeded = true; + droppedDocuments.Add(documentWithResponse); + } + } + else + { + droppedDocuments.Add(documentWithResponse); + } + } + + HandleDroppedDocuments(droppedDocuments, response); + + if (retryableDocsRemainingAfterRetriesExceeded) + { + throw ThrowOnBadBulk(response, $"Bulk indexing failed and after retrying {backOffRetries} times."); + } + else if (retryableDocuments.Count > 0) + { + return await RetryDocumentsAsync(page, ++backOffRetries, retryableDocuments).ConfigureAwait(false); + } + + request.BackPressure?.Release(); + + return new BulkAllResponse { Retries = backOffRetries, Page = page, Items = response.Items }; + } + + private void HandleDroppedDocuments(List> droppedDocuments, BulkResponse response) + { + if (droppedDocuments.Count <= 0) + return; + + foreach (var dropped in droppedDocuments) + _droppedDocumentCallBack(dropped.Item1, dropped.Item2); + + if (!_partitionedBulkRequest.ContinueAfterDroppedDocuments) + throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after receiving failures that can not be retried from _bulk"); + } + + private async Task HandleBulkRequestAsync(IList buffer, long page, int backOffRetries, BulkResponse response) + { + var clientException = response.ApiCallDetails.OriginalException as TransportException; + var failureReason = clientException?.FailureReason; + var reason = failureReason?.GetStringValue() ?? nameof(PipelineFailure.BadRequest); + switch (failureReason) + { + case PipelineFailure.MaxRetriesReached: + if (response.ApiCallDetails.AuditTrail.Last().Event == AuditEvent.FailedOverAllNodes) + throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after attempted bulk failed over all the active nodes"); + + ThrowOnExhaustedRetries(); + return await RetryDocumentsAsync(page, ++backOffRetries, buffer).ConfigureAwait(false); + case PipelineFailure.CouldNotStartSniffOnStartup: + case PipelineFailure.BadAuthentication: + case PipelineFailure.NoNodesAttempted: + case PipelineFailure.SniffFailure: + case PipelineFailure.Unexpected: + throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after {nameof(PipelineFailure)}.{reason} from _bulk"); + case PipelineFailure.BadResponse: + case PipelineFailure.PingFailure: + case PipelineFailure.MaxTimeoutReached: + case PipelineFailure.BadRequest: + default: + ThrowOnExhaustedRetries(); + return await RetryDocumentsAsync(page, ++backOffRetries, buffer).ConfigureAwait(false); + } + + void ThrowOnExhaustedRetries() + { + if (backOffRetries < _backOffRetries) + return; + + throw ThrowOnBadBulk(response, + $"{nameof(BulkAll)} halted after {nameof(PipelineFailure)}.{reason} from _bulk and exhausting retries ({backOffRetries})"); + } + } + + private async Task RetryDocumentsAsync(long page, int backOffRetries, IList retryDocuments) + { + _incrementRetries(); + await Task.Delay(_backOffTime, _compositeCancelToken).ConfigureAwait(false); + return await BulkAsync(retryDocuments, page, backOffRetries).ConfigureAwait(false); + } + + private Exception ThrowOnBadBulk(ElasticsearchResponse response, string message) + { + _incrementFailed(); + _partitionedBulkRequest.BackPressure?.Release(); + return Throw(message, response); + } + + private static bool RetryBulkActionPredicate(ResponseItem bulkResponseItem, T d) => bulkResponseItem.Status == 429; + + private static void DroppedDocumentCallbackDefault(ResponseItem bulkResponseItem, T d) { } + + public void Dispose() + { + if (!_disposedValue) + { + _compositeCancelTokenSource?.Cancel(); + _compositeCancelTokenSource?.Dispose(); + + _disposedValue = true; + } + } + + public IDisposable Subscribe(IObserver observer) + { + observer.ThrowIfNull(nameof(observer)); + BulkAll(observer); + return this; + } + + private static TransportException Throw(string message, ElasticsearchResponse details) => + new(PipelineFailure.BadResponse, message, details); +} + +#endif diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObserver.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObserver.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObserver.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObserver.cs index d0e0b327264..a5d810090a4 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObserver.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllObserver.cs @@ -5,7 +5,11 @@ using System; using System.Threading; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class BulkAllObserver : CoordinatedRequestObserverBase { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllRequest.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Helpers/BulkAllRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllRequest.cs index 131b127a268..391b40c1955 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllRequest.cs @@ -6,10 +6,22 @@ using System.Collections.Generic; using System.Text.Json; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class BulkAllRequest : IBulkAllRequest, IHelperCallable { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllResponse.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/Helpers/BulkAllResponse.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllResponse.cs index 396c4e8bfc3..567a0d6baba 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/BulkAllResponse.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class BulkAllResponse { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestDefaults.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestDefaults.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestDefaults.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestDefaults.cs index 930ffdddf13..c6ad0dec3e1 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestDefaults.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestDefaults.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class CoordinatedRequestDefaults { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestObserverBase.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestObserverBase.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestObserverBase.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestObserverBase.cs index 5f66f7f0367..bf0b4bb9980 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/CoordinatedRequestObserverBase.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/CoordinatedRequestObserverBase.cs @@ -5,7 +5,11 @@ using System; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public abstract class CoordinatedRequestObserverBase : IObserver { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/HelperIdentifiers.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/HelperIdentifiers.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Helpers/HelperIdentifiers.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/HelperIdentifiers.cs index 156bcd50c9f..e44d73ba972 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/HelperIdentifiers.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/HelperIdentifiers.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class HelperIdentifiers { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/IBulkAllRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/IBulkAllRequest.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Helpers/IBulkAllRequest.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/IBulkAllRequest.cs index ee368951c8c..8b0c5133dc1 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/IBulkAllRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/IBulkAllRequest.cs @@ -4,9 +4,17 @@ using System; using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else using Elastic.Clients.Elasticsearch.Core.Bulk; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public interface IBulkAllRequest { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/IHelperCallable.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/IHelperCallable.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Helpers/IHelperCallable.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/IHelperCallable.cs index 18f320b85c0..8ca3e936d73 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/IHelperCallable.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/IHelperCallable.cs @@ -4,7 +4,11 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif /// /// May be applied to helper requests where they may be called by an upstream helper. diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/PartitionHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/PartitionHelper.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Helpers/PartitionHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/PartitionHelper.cs index ea89d130820..dc28a29f92a 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/PartitionHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/PartitionHelper.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal class PartitionHelper : IEnumerable> { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/ProducerConsumerBackPressure.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/ProducerConsumerBackPressure.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Helpers/ProducerConsumerBackPressure.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/ProducerConsumerBackPressure.cs index d7e8db23c82..3ace1481f88 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/ProducerConsumerBackPressure.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/ProducerConsumerBackPressure.cs @@ -6,7 +6,11 @@ using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed class ProducerConsumerBackPressure { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataExtensions.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataExtensions.cs index 591981f17a8..88f4c3d1c57 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataExtensions.cs @@ -5,7 +5,11 @@ using System; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class RequestMetaDataExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataFactory.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataFactory.cs index 87a76eb77f6..7208249e327 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/RequestMetaDataFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestMetaDataFactory.cs @@ -4,7 +4,11 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class RequestMetaDataFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/RequestParametersExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestParametersExtensions.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Helpers/RequestParametersExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestParametersExtensions.cs index 9748a2c13ca..0640c806a70 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/RequestParametersExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Helpers/RequestParametersExtensions.cs @@ -6,7 +6,11 @@ using System; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif internal static class RequestParametersExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/AggregationSerializationHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/Serialization/AggregationSerializationHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs index 01caf035b19..3f6e1f856d4 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/AggregationSerializationHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else using Elastic.Clients.Elasticsearch.Aggregations; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class AggregationSerializationHelper { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverter.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverter.cs index 1ff99774725..f7ff0ed0f86 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class CustomJsonWriterConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverterFactory.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverterFactory.cs index 434331acc38..5f9913fabe2 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/CustomJsonWriterConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomJsonWriterConverterFactory.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class CustomJsonWriterConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/CustomizedNamingPolicy.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomizedNamingPolicy.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Serialization/CustomizedNamingPolicy.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomizedNamingPolicy.cs index ae9ff4b20e4..2a756018f4f 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/CustomizedNamingPolicy.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/CustomizedNamingPolicy.cs @@ -5,7 +5,11 @@ using System; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal class CustomizedNamingPolicy : JsonNamingPolicy { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultRequestResponseSerializer.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultRequestResponseSerializer.cs index 1f3a4771c3d..24bac703c95 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultRequestResponseSerializer.cs @@ -9,7 +9,11 @@ using System.Threading.Tasks; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// The built in internal serializer that the uses to serialize @@ -22,7 +26,7 @@ internal class DefaultRequestResponseSerializer : SystemTextJsonSerializer public DefaultRequestResponseSerializer(IElasticsearchClientSettings settings) : base(settings) { _jsonSerializerOptions = new JsonSerializerOptions - { + { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, IncludeFields = true, Converters = diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultSourceSerializer.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultSourceSerializer.cs index 9243018cb84..4baffcc168c 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DefaultSourceSerializer.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// The built in internal serializer that the uses to serialize @@ -93,7 +97,7 @@ public static JsonSerializerOptions AddDefaultConverters(JsonSerializerOptions o options.Converters.Add(converter); } - return options; + return options; } protected sealed override JsonSerializerOptions CreateJsonSerializerOptions() => _jsonSerializerOptions; diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DictionaryResponseConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DictionaryResponseConverter.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/DictionaryResponseConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/DictionaryResponseConverter.cs index 374b0667765..909b0292068 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DictionaryResponseConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DictionaryResponseConverter.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class DictionaryResponseConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DoubleWithFractionalPortionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DoubleWithFractionalPortionConverter.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/DoubleWithFractionalPortionConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/DoubleWithFractionalPortionConverter.cs index 911f69f399e..6ccba78f21d 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DoubleWithFractionalPortionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/DoubleWithFractionalPortionConverter.cs @@ -21,7 +21,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class DoubleWithFractionalPortionConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/EnumStructConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/EnumStructConverter.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Serialization/EnumStructConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/EnumStructConverter.cs index 7bfb00d91dc..80de1fa303d 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/EnumStructConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/EnumStructConverter.cs @@ -5,9 +5,17 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core; +#else using Elastic.Clients.Elasticsearch.Core; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class EnumStructConverter : JsonConverter where T : struct, IEnumStruct { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/GenericConverterAttribute.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/GenericConverterAttribute.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/GenericConverterAttribute.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/GenericConverterAttribute.cs index efe2547dd06..6812414709b 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/GenericConverterAttribute.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/GenericConverterAttribute.cs @@ -6,7 +6,11 @@ using System.Reflection; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// A custom used to dynamically create diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ICustomJsonWriter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ICustomJsonWriter.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/Serialization/ICustomJsonWriter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ICustomJsonWriter.cs index ba1d7f315b7..d64a10f4cb1 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ICustomJsonWriter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ICustomJsonWriter.cs @@ -5,9 +5,13 @@ using System.Text.Json; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal interface ICustomJsonWriter -{ +{ void WriteJson(Utf8JsonWriter writer, Serializer sourceSerializer); } diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ISourceMarker.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ISourceMarker.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/Serialization/ISourceMarker.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ISourceMarker.cs index 70308dd7f03..a8cf2520d1f 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ISourceMarker.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ISourceMarker.cs @@ -2,6 +2,10 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal interface ISourceMarker { } diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/IStreamSerializable.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IStreamSerializable.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Serialization/IStreamSerializable.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/IStreamSerializable.cs index 8bd24041108..63549e092cd 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/IStreamSerializable.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IStreamSerializable.cs @@ -6,7 +6,11 @@ using Elastic.Transport; using System.IO; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// Used to mark types which expect to directly serialize into a stream. This supports non-json compliant output such as NDJSON. diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/IUnionVerifiable.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IUnionVerifiable.cs similarity index 75% rename from src/Elastic.Clients.Elasticsearch/Serialization/IUnionVerifiable.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/IUnionVerifiable.cs index 51fac87e1c9..61770f76849 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/IUnionVerifiable.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IUnionVerifiable.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal interface IUnionVerifiable { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverter.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverter.cs index dd48123d8f9..280ac0552c8 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class InterfaceConverter : JsonConverter where TConcrete : class, TInterface diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverterAttribute.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverterAttribute.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverterAttribute.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverterAttribute.cs index b53215f504a..8a0ae48f724 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/InterfaceConverterAttribute.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/InterfaceConverterAttribute.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif [AttributeUsage(AttributeTargets.Interface)] internal class InterfaceConverterAttribute : Attribute diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/IntermediateSourceConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IntermediateSourceConverter.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Serialization/IntermediateSourceConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/IntermediateSourceConverter.cs index abc4703b5f8..691d1091337 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/IntermediateSourceConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IntermediateSourceConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class IntermediateSourceConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/IsADictionaryConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IsADictionaryConverterFactory.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Serialization/IsADictionaryConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/IsADictionaryConverterFactory.cs index 3d36da2a1ea..4d0261ac4fa 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/IsADictionaryConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/IsADictionaryConverterFactory.cs @@ -6,9 +6,17 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else using Elastic.Clients.Elasticsearch.Mapping; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class IsADictionaryConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/JsonConstants.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonConstants.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Serialization/JsonConstants.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonConstants.cs index 3c28f552a46..3b1b4376108 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/JsonConstants.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonConstants.cs @@ -11,7 +11,11 @@ #endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class JsonConstants { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/JsonHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonHelper.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Serialization/JsonHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonHelper.cs index 1e02bd31afc..19d4e1252a8 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/JsonHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonHelper.cs @@ -4,7 +4,11 @@ using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class JsonHelper { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/JsonSerializerOptionsExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonSerializerOptionsExtensions.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/Serialization/JsonSerializerOptionsExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonSerializerOptionsExtensions.cs index 3a8742c1962..8f4ab29ee2f 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/JsonSerializerOptionsExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/JsonSerializerOptionsExtensions.cs @@ -4,7 +4,11 @@ using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class JsonSerializerOptionsExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/KeyValuePairConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/KeyValuePairConverter.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Serialization/KeyValuePairConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/KeyValuePairConverter.cs index 5100d38c850..3e39dfa4369 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/KeyValuePairConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/KeyValuePairConverter.cs @@ -9,7 +9,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class KeyValuePairConverterFactory : JsonConverterFactory { @@ -43,7 +47,7 @@ public override KeyValuePair Read(ref Utf8JsonReader reader, Typ throw new JsonException("Unexpected token for KeyValuePair"); reader.Read(); // property name (key) - var keyString = reader.GetString(); + var keyString = reader.GetString(); reader.Read(); // value var value = JsonSerializer.Deserialize(ref reader, options); diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/MultiItemUnionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/MultiItemUnionConverter.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/MultiItemUnionConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/MultiItemUnionConverter.cs index b98a48f6f6d..3a8354ad3ee 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/MultiItemUnionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/MultiItemUnionConverter.cs @@ -6,9 +6,17 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core; +#else using Elastic.Clients.Elasticsearch.Core; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// A base converter for any multi-item (>2 items) unions. The code-generator creates a @@ -76,7 +84,7 @@ internal abstract class MultiItemUnionConverter : JsonConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ObjectToInferredTypesConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ObjectToInferredTypesConverter.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Serialization/ObjectToInferredTypesConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ObjectToInferredTypesConverter.cs index 23a7cff7220..e22f246fa2d 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ObjectToInferredTypesConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ObjectToInferredTypesConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class ObjectToInferredTypesConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/PropertyNameConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/PropertyNameConverter.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Serialization/PropertyNameConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/PropertyNameConverter.cs index 8ed87f2be87..40bdd478c9c 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/PropertyNameConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/PropertyNameConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class PropertyNameConverter : SettingsJsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/QueryConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/QueryConverter.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Serialization/QueryConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/QueryConverter.cs index 2210f6ad23d..a408fb7a30e 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/QueryConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/QueryConverter.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif // This converter is generated for the Query container type. We add the CanConvert override here (for now) // as the Query type may be used in source POCOs. diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyFieldDictionaryConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyFieldDictionaryConverter.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyFieldDictionaryConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyFieldDictionaryConverter.cs index 231a7b85c4b..853f538fe62 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyFieldDictionaryConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyFieldDictionaryConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class ReadOnlyFieldDictionaryConverterAttribute : JsonConverterAttribute { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyIndexNameDictionaryConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyIndexNameDictionaryConverter.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyIndexNameDictionaryConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyIndexNameDictionaryConverter.cs index 4d585c65680..c1d29d6fe35 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ReadOnlyIndexNameDictionaryConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ReadOnlyIndexNameDictionaryConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class ReadOnlyIndexNameDictionaryConverter : JsonConverterAttribute { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs index 16f0e433e36..bc58d7dada9 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResolvableReadonlyDictionaryConverterFactory.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class ResolvableReadonlyDictionaryConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/ResponseItemConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResponseItemConverterFactory.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Serialization/ResponseItemConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResponseItemConverterFactory.cs index 06f503d1e55..da50972972b 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/ResponseItemConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/ResponseItemConverterFactory.cs @@ -5,10 +5,22 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Get; +#else using Elastic.Clients.Elasticsearch.Core.Get; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.MGet; +#else using Elastic.Clients.Elasticsearch.Core.MGet; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// A converter factory able to provide a converter to handle (de)serializing . diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializable.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializable.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializable.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializable.cs index 1f40c872ca9..1a4fd1cf9ad 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializable.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializable.cs @@ -4,7 +4,11 @@ using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// Marks a type to provide it's own serialization code. diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializableConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializableConverterFactory.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializableConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializableConverterFactory.cs index b1095fdc9d8..8fb0b39a204 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SelfSerializableConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SelfSerializableConverterFactory.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SelfSerializableConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SerializationConstants.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializationConstants.cs similarity index 76% rename from src/Elastic.Clients.Elasticsearch/Serialization/SerializationConstants.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializationConstants.cs index 006daf3a91c..74d868fada4 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SerializationConstants.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializationConstants.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class SerializationConstants { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SerializerExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializerExtensions.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Serialization/SerializerExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializerExtensions.cs index 3101c7b6b94..8f756b29363 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SerializerExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SerializerExtensions.cs @@ -5,7 +5,11 @@ using System.Text.Json; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class SerializerExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SettingsJsonConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SettingsJsonConverter.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Serialization/SettingsJsonConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SettingsJsonConverter.cs index 486bac3ae13..21190673061 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SettingsJsonConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SettingsJsonConverter.cs @@ -5,7 +5,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// Used for derived converters which need access to in order to serialize. diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SimpleInterfaceConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SimpleInterfaceConverter.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Serialization/SimpleInterfaceConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SimpleInterfaceConverter.cs index 65a1a75c86a..4a4315f08db 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SimpleInterfaceConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SimpleInterfaceConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SimpleInterfaceConverter : JsonConverter where TConcrete : class, TInterface { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionAttribute.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionAttribute.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionAttribute.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionAttribute.cs index 1761ab6db7b..22581f4fc9e 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionAttribute.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionAttribute.cs @@ -5,7 +5,11 @@ using System; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif [AttributeUsage(AttributeTargets.Property)] internal class SingleOrManyCollectionConverterAttribute : JsonConverterAttribute diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionConverter.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionConverter.cs index 90beedf2efd..bb734416a2c 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManyCollectionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManyCollectionConverter.cs @@ -7,14 +7,18 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal class SingleOrManyCollectionConverter : JsonConverter> { public override ICollection? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => SingleOrManySerializationHelper.Deserialize(ref reader, options); - public override void Write(Utf8JsonWriter writer, ICollection value, JsonSerializerOptions options) => + public override void Write(Utf8JsonWriter writer, ICollection value, JsonSerializerOptions options) => SingleOrManySerializationHelper.Serialize(value, writer, options); public override bool CanConvert(Type typeToConvert) => true; diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManySerializationHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManySerializationHelper.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManySerializationHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManySerializationHelper.cs index 9403dec628d..b2a47e52539 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SingleOrManySerializationHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleOrManySerializationHelper.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class SingleOrManySerializationHelper { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SingleWithFractionalPortionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleWithFractionalPortionConverter.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/SingleWithFractionalPortionConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleWithFractionalPortionConverter.cs index 279516fcfbf..731b07d58a0 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SingleWithFractionalPortionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SingleWithFractionalPortionConverter.cs @@ -21,7 +21,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SingleWithFractionalPortionConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverter.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Serialization/SourceConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverter.cs index ae9e007ed6e..527210510c9 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverter.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SourceConverter : JsonConverter> { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterAttribute.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterAttribute.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterAttribute.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterAttribute.cs index d7d3e06fb02..2b166d3c612 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterAttribute.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterAttribute.cs @@ -5,7 +5,11 @@ using System; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SourceConverterAttribute : JsonConverterAttribute { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterFactory.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterFactory.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterFactory.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterFactory.cs index d576c964a4b..c0e5adc9ffd 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceConverterFactory.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceConverterFactory.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SourceConverterFactory : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceMarker.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceMarker.cs similarity index 75% rename from src/Elastic.Clients.Elasticsearch/Serialization/SourceMarker.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceMarker.cs index 7cb89ef1d84..70ed8c5335f 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceMarker.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceMarker.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class SourceMarker { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialization.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceSerialization.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialization.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceSerialization.cs index c034c941857..78fcc25dd98 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialization.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SourceSerialization.cs @@ -7,7 +7,11 @@ using System.Text.Json; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// May be used by requests that need to serialize only part of their source rather than the request object itself. diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/StringAliasConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringAliasConverter.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Serialization/StringAliasConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringAliasConverter.cs index a1107687c1a..4271f61dcf2 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/StringAliasConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringAliasConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif // TODO - In .NET 7 we could review supporting IParsable as a type constraint? internal sealed class StringAliasConverter : JsonConverter diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/StringEnumAttribute.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringEnumAttribute.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch/Serialization/StringEnumAttribute.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringEnumAttribute.cs index 2bdf4c83d18..1edcc2a1cc8 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/StringEnumAttribute.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/StringEnumAttribute.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif [AttributeUsage(AttributeTargets.Property | AttributeTargets.Enum)] public class StringEnumAttribute : Attribute { } diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/Stringified.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/Stringified.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs index e392441c82c..607d1b15fcd 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/Stringified.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class StringifiedLongConverter : JsonConverter { @@ -87,4 +91,4 @@ public static bool ReadStringifiedBool(ref Utf8JsonReader reader) return reader.GetBoolean(); } -} \ No newline at end of file +} diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SystemTextJsonSerializer.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SystemTextJsonSerializer.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Serialization/SystemTextJsonSerializer.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/SystemTextJsonSerializer.cs index b6c4ec03bb1..3d3e3f8b6f2 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SystemTextJsonSerializer.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/SystemTextJsonSerializer.cs @@ -9,7 +9,11 @@ using System.Threading.Tasks; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif /// /// An abstract implementation of the transport which serializes @@ -25,7 +29,7 @@ public abstract class SystemTextJsonSerializer : Serializer private bool _initialized; /// - /// Initializes a new instance of the class, linked to an + /// Initializes a new instance of the class, linked to an /// instance of . /// /// An instance to which this @@ -54,7 +58,7 @@ public SystemTextJsonSerializer(IElasticsearchClientSettings settings) /// be used when serializing. /// /// - protected abstract JsonSerializerOptions CreateJsonSerializerOptions(); + protected abstract JsonSerializerOptions CreateJsonSerializerOptions(); /// public override T Deserialize(Stream stream) diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/TermsAggregateSerializationHelper.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/TermsAggregateSerializationHelper.cs index 87d1e8e6882..d3e0e72294f 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/TermsAggregateSerializationHelper.cs @@ -5,9 +5,17 @@ using System; using System.Text.Json; using System.Text; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else using Elastic.Clients.Elasticsearch.Aggregations; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal static class TermsAggregateSerializationHelper { diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/UnionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Serialization/UnionConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs index 9908f3013fc..b01a68b2060 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/UnionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs @@ -6,9 +6,17 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else using Elastic.Clients.Elasticsearch.Aggregations; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else namespace Elastic.Clients.Elasticsearch.Serialization; +#endif internal sealed class UnionConverter : JsonConverterFactory { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs index 2a97405ab8f..b4513b3da27 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs @@ -6,9 +6,17 @@ using System.Collections.Generic; using System.Text.Json.Serialization; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif internal sealed class AggregateDictionaryConverter : JsonConverter { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateOrder.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateOrder.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateOrder.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateOrder.cs index 1a8aba299ff..6ce16971c97 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateOrder.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateOrder.cs @@ -4,7 +4,11 @@ using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public static class AggregateOrder { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/Aggregation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/Aggregation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs index 4799bdde9ad..b7d580e9e15 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/Aggregation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs @@ -5,7 +5,11 @@ using System; using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public partial class Aggregation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs index 3f59447a495..35a7bc42f89 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs @@ -4,7 +4,11 @@ using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public partial class AggregationDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs index 349766d8b3e..9b66388d842 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public sealed class TermsAggregate : IAggregate { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs index dd7f5965325..c467fdadd23 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs @@ -4,7 +4,11 @@ using System.Collections.Generic; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public partial class TermsAggregationDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsBucket.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsBucket.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs index 424b42cf2dc..9ed0679ff3d 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsBucket.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif public sealed class TermsBucket : AggregateDictionary { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsExclude.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsExclude.cs index d15316c8562..0f4c415a100 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsExclude.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; #nullable enable +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif /// /// Filters which terms to exclude from the response. @@ -96,6 +100,6 @@ public override void Write(Utf8JsonWriter writer, TermsExclude value, JsonSerial return; } - writer.WriteStringValue(value.RegexPattern); + writer.WriteStringValue(value.RegexPattern); } } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsInclude.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsInclude.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsInclude.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsInclude.cs index 2861d59703c..00b6cf85974 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsInclude.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsInclude.cs @@ -8,7 +8,11 @@ using System.Text.Json.Serialization; #nullable enable +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +#else namespace Elastic.Clients.Elasticsearch.Aggregations; +#endif /// /// Filters which terms to include in the response. diff --git a/src/Elastic.Clients.Elasticsearch/Types/AsyncSearch/AsyncSearch.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Types/AsyncSearch/AsyncSearch.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs index a5d6b8ad9f8..cad838dd26c 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/AsyncSearch/AsyncSearch.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; +#else namespace Elastic.Clients.Elasticsearch.AsyncSearch; +#endif public partial class AsyncSearch { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperation.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperation.cs index eddd9f24caa..f04ffd238e4 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperation.cs @@ -8,9 +8,17 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif /// /// Represents a bulk operation to create a document. diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperationDescriptor.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperationDescriptor.cs index 1e71ed21dd6..16a1bb4e31b 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkCreateOperationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkCreateOperationDescriptor.cs @@ -8,11 +8,23 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkCreateOperationDescriptor : BulkOperationDescriptor> { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperation.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperation.cs index b89726fc1b2..6e91d811f93 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperation.cs @@ -7,9 +7,17 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public class BulkDeleteOperation : BulkOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs index 9fe9dc6024c..8ad8e2a4ba0 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkDeleteOperationDescriptor.cs @@ -7,10 +7,18 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public class BulkDeleteOperationDescriptor : BulkOperationDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperation.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperation.cs index 92e10f12151..799138d6597 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperation.cs @@ -8,9 +8,17 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkIndexOperation : BulkOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperationDescriptor.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperationDescriptor.cs index ee7d2b1f3c5..df959ebbec7 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkIndexOperationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkIndexOperationDescriptor.cs @@ -8,16 +8,28 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkIndexOperationDescriptor : BulkOperationDescriptor> { private string _pipeline; - + private Dictionary _dynamicTemplates; private static byte _newline => (byte)'\n'; diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperation.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperation.cs index c76f0f6fea3..861543eecd2 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperation.cs @@ -6,10 +6,18 @@ using System.IO; using System.Text.Json.Serialization; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif /// /// Provides the base class from which the classes that represent bulk operations are derived. @@ -62,7 +70,7 @@ internal BulkOperation() { } public Routing? Routing { get; set; } /// - /// Each bulk operation can include the version value for the document. + /// Each bulk operation can include the version value for the document. /// /// This automatically follows the behavior of the index/delete operation based on the _version mapping. [JsonPropertyName("version")] diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationDescriptor.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationDescriptor.cs index 0451a0ba7c8..c8103d07e5b 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationDescriptor.cs @@ -7,11 +7,23 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public abstract class BulkOperationDescriptor : SerializableDescriptor, IBulkOperation, IStreamSerializable where TDescriptor : BulkOperationDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationsCollection.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationsCollection.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationsCollection.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationsCollection.cs index 80cc7e01cdb..85b12f55a8a 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkOperationsCollection.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkOperationsCollection.cs @@ -7,10 +7,18 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif ///// ///// This class is used by which needs thread-safe adding , as well as expose diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkResponseItemConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkResponseItemConverter.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkResponseItemConverter.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkResponseItemConverter.cs index 992bcd61e8d..4881e942d03 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkResponseItemConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkResponseItemConverter.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif internal sealed class BulkResponseItemConverter : JsonConverter> { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateBody.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateBody.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateBody.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateBody.cs index 3978d017306..0fca0d084c9 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateBody.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateBody.cs @@ -3,10 +3,22 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else using Elastic.Clients.Elasticsearch.Core.Search; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif internal abstract class BulkUpdateBody : ISelfSerializable { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperation.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperation.cs index 9820d4c55d9..a36d9bb0c6c 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperation.cs @@ -7,10 +7,18 @@ using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public abstract class BulkUpdateOperation : BulkOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs index d46235860ec..7af3b4d42ba 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationDescriptor.cs @@ -9,10 +9,22 @@ using System.Threading; using System.Threading.Tasks; using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else using Elastic.Clients.Elasticsearch.Core.Search; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkUpdateOperationDescriptor : BulkOperationDescriptor> { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationT.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationT.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationT.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationT.cs index 0272e5f9ae0..07eab380c94 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationT.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationT.cs @@ -7,9 +7,17 @@ using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else using Elastic.Clients.Elasticsearch.Core.Search; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkUpdateOperation : BulkUpdateOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs index 8ad17bb279a..26c09249de3 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithPartial.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkUpdateOperationWithPartial : BulkUpdateOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithScript.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithScript.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithScript.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithScript.cs index d3feccab61d..92663e6851a 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/BulkUpdateOperationWithScript.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/BulkUpdateOperationWithScript.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public class BulkUpdateOperationWithScript : BulkUpdateOperation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/IBulkOperation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/IBulkOperation.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/IBulkOperation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/IBulkOperation.cs index ed6e49ba40c..70edfd8397f 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/IBulkOperation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/IBulkOperation.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif /// /// Marker interface for types that can be serialised as an operation of a bulk API request. diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/PartialBulkUpdateBody.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/PartialBulkUpdateBody.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/PartialBulkUpdateBody.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/PartialBulkUpdateBody.cs index 76eebb08e2b..0be20a6f539 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/PartialBulkUpdateBody.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/PartialBulkUpdateBody.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif internal class PartialBulkUpdateBody : BulkUpdateBody { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkCreateResponseItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkCreateResponseItem.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkCreateResponseItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkCreateResponseItem.cs index 6e183cbb35c..0e59d96e7ed 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkCreateResponseItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkCreateResponseItem.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class CreateResponseItem : ResponseItem { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs index d7462faf2d5..f7d3bf5698a 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkDeleteResponseItem.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkDeleteResponseItem : ResponseItem { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkIndexResponseItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkIndexResponseItem.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkIndexResponseItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkIndexResponseItem.cs index 4b6c0219107..c1e5dac1bf1 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkIndexResponseItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkIndexResponseItem.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkIndexResponseItem : ResponseItem { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs index ac2530b6e5d..636d8992580 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/Response/BulkUpdateResponseItem.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif public sealed class BulkUpdateResponseItem : ResponseItem { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/ScriptedBulkUpdateBody.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/ScriptedBulkUpdateBody.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/ScriptedBulkUpdateBody.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/ScriptedBulkUpdateBody.cs index 3da68f1113c..2e25090e4fa 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Bulk/ScriptedBulkUpdateBody.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Bulk/ScriptedBulkUpdateBody.cs @@ -3,9 +3,17 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; +#else namespace Elastic.Clients.Elasticsearch.Core.Bulk; +#endif internal class ScriptedBulkUpdateBody : BulkUpdateBody { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/MSearch/SearchRequestItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearch/SearchRequestItem.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Types/Core/MSearch/SearchRequestItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearch/SearchRequestItem.cs index 9aad2fa358e..cf344602f0e 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/MSearch/SearchRequestItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearch/SearchRequestItem.cs @@ -5,10 +5,18 @@ using System.IO; using System.Text.Json; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; +#else namespace Elastic.Clients.Elasticsearch.Core.MSearch; +#endif // POC - If we have more than one union doing this, can we autogenerate with correct ctors etc. public sealed class SearchRequestItem : IStreamSerializable @@ -19,7 +27,7 @@ public SearchRequestItem(MultisearchHeader header, MultisearchBody body) { Header = header; Body = body; - } + } public MultisearchHeader Header { get; init; } public MultisearchBody Body { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs index b2c44d7c227..49f57a30683 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/MSearchTemplate/SearchTemplateRequestItem.cs @@ -5,11 +5,23 @@ using System.IO; using System.Text.Json; using System.Threading.Tasks; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; +#else using Elastic.Clients.Elasticsearch.Core.MSearch; +#endif +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate; +#else namespace Elastic.Clients.Elasticsearch.Core.MSearchTemplate; +#endif public sealed class SearchTemplateRequestItem : IStreamSerializable { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Core/Search/SuggestDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs similarity index 96% rename from src/Elastic.Clients.Elasticsearch/Types/Core/Search/SuggestDictionary.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs index 74be84370f1..692e800b9b9 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Core/Search/SuggestDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs @@ -8,9 +8,17 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else namespace Elastic.Clients.Elasticsearch.Core.Search; +#endif [GenericConverter(typeof(SuggestDictionaryConverter<>), unwrap:true)] public sealed partial class SuggestDictionary : diff --git a/src/Elastic.Clients.Elasticsearch/Types/FieldSort.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/FieldSort.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/FieldSort.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/FieldSort.cs index ea4cd931ea7..facf19d1b8b 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/FieldSort.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/FieldSort.cs @@ -5,9 +5,17 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else using Elastic.Clients.Elasticsearch.Mapping; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(FieldSortConverter))] public partial class FieldSort diff --git a/src/Elastic.Clients.Elasticsearch/Types/GeoLocation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/GeoLocation.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/Types/GeoLocation.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/GeoLocation.cs index e3a6e3b4d10..aa823d9402b 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/GeoLocation.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/GeoLocation.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class GeoLocation { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Mapping/Properties.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/Properties.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Types/Mapping/Properties.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/Properties.cs index 6b0ebb9d460..70852e0b977 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Mapping/Properties.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/Properties.cs @@ -6,9 +6,17 @@ using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else namespace Elastic.Clients.Elasticsearch.Mapping; +#endif [JsonConverter(typeof(PropertiesConverter))] public partial class Properties diff --git a/src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertiesDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertiesDescriptor.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertiesDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertiesDescriptor.cs index 9bfb6107178..6e3a3ee74da 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertiesDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertiesDescriptor.cs @@ -5,9 +5,17 @@ using System; using System.Collections.Generic; using System.Linq.Expressions; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else namespace Elastic.Clients.Elasticsearch.Mapping; +#endif public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, PropertyName, IProperty> diff --git a/src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertyNameExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertyNameExtensions.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertyNameExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertyNameExtensions.cs index df487687f72..15349dd35f2 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Mapping/PropertyNameExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Mapping/PropertyNameExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; +#else namespace Elastic.Clients.Elasticsearch.Mapping; +#endif internal static class PropertyNameExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Types/MultiSearchItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Types/MultiSearchItem.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs index 250950cc9fc..a3e2cbd8f0a 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/MultiSearchItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs @@ -6,7 +6,11 @@ using System.Linq; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; +#else namespace Elastic.Clients.Elasticsearch.Core.MSearch; +#endif public partial class MultiSearchItem { diff --git a/src/Elastic.Clients.Elasticsearch/Types/OpType.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/OpType.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Types/OpType.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/OpType.cs index 84ca5084548..32dd006f264 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/OpType.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/OpType.cs @@ -4,7 +4,11 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial struct OpType : IStringable { diff --git a/src/Elastic.Clients.Elasticsearch/Types/PointInTimeReferenceDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/PointInTimeReferenceDescriptor.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch/Types/PointInTimeReferenceDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/PointInTimeReferenceDescriptor.cs index 0370f78f5b8..1adf99f8921 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/PointInTimeReferenceDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/PointInTimeReferenceDescriptor.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else namespace Elastic.Clients.Elasticsearch.Core.Search; +#endif public sealed partial class PointInTimeReferenceDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQuery.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQuery.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQuery.cs index 2efca3b70a3..184947b5bf2 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQuery.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif public partial class BoolQuery { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryAndExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryAndExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs index 272f72428d0..4e42adf6eb2 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryAndExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs @@ -6,7 +6,11 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif internal static class BoolQueryAndExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryExtensions.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryExtensions.cs index 38af2755d39..1cc438d1897 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryExtensions.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif internal static class BoolQueryExtensions { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryOrExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryOrExtensions.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryOrExtensions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryOrExtensions.cs index 3be41d8d08d..22f2baf139d 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/BoolQueryOrExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryOrExtensions.cs @@ -5,7 +5,11 @@ using System.Collections.Generic; using System.Linq; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif internal static class BoolQueryOrExtensions { @@ -16,7 +20,7 @@ internal static Query CombineAsShould(this Query leftContainer, Query rightConta if (TryFlattenShould(leftContainer, rightContainer, leftBool, rightBool, out var c)) return c; - + var lHasShouldQueries = hasLeftBool && leftBool.Should.HasAny(); var rHasShouldQueries = hasRightBool && rightBool.Should.HasAny(); diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/FunctionScore.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/FunctionScore.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/FunctionScore.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/FunctionScore.cs index 21248c619a2..ca170eba4bf 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/FunctionScore.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/FunctionScore.cs @@ -2,7 +2,11 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif // A quirk of the function score type which is valid without a variant. diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/Query.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/Query.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs index ebdf046a127..70da58ca951 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/Query.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs @@ -5,7 +5,11 @@ using System; using System.Diagnostics.CodeAnalysis; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif public partial class Query { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryDescriptor.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs index 8525ed407af..bd840944a89 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs @@ -5,7 +5,11 @@ using System; using System.Linq.Expressions; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif public sealed partial class QueryDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RangeQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RangeQuery.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs index 6264da9eb77..f6cfc947ce5 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RangeQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs @@ -6,9 +6,17 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +#else using Elastic.Clients.Elasticsearch.Fluent; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif [JsonConverter(typeof(RangeQueryConverter))] public class RangeQuery : SearchQuery diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RawJsonQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RawJsonQuery.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs index 181c4d5f868..26ed57a94db 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/RawJsonQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif /// /// Allows a query represented as a string of JSON to be defined. This can be useful when support for a built-in query is not yet available. diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/SearchQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/QueryDsl/SearchQuery.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs index 9ea7350f0b8..a0f5928ad1e 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/SearchQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs @@ -4,7 +4,11 @@ using System; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +#else namespace Elastic.Clients.Elasticsearch.QueryDsl; +#endif /// /// A base type for all query variants. diff --git a/src/Elastic.Clients.Elasticsearch/Types/Ranges.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Ranges.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Ranges.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Ranges.cs index a146f6ecde2..ac04ad19229 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Ranges.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Ranges.cs @@ -5,7 +5,11 @@ using System; using System.Runtime.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public class DateRange { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Refresh.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Refresh.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/Types/Refresh.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Refresh.cs index c4f41a86102..9a2e7b99acb 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Refresh.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Refresh.cs @@ -4,7 +4,11 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial struct Refresh : IStringable { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Scripting/InlineScript.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/InlineScript.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/Types/Scripting/InlineScript.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/InlineScript.cs index 3095fb42560..228e5c1dbc7 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Scripting/InlineScript.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/InlineScript.cs @@ -6,9 +6,17 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public sealed partial class InlineScript : ISelfTwoWaySerializable { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Scripting/Script.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/Script.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/Scripting/Script.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/Script.cs index 51e06c67f5d..11a839b1c69 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Scripting/Script.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Scripting/Script.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(ScriptConverter))] public partial class Script diff --git a/src/Elastic.Clients.Elasticsearch/Types/SortOptions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/SortOptions.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/SortOptions.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/SortOptions.cs index 713272d31ff..cbbe2c06568 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/SortOptions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/SortOptions.cs @@ -5,10 +5,18 @@ using System; using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +#else using Elastic.Clients.Elasticsearch.Serialization; +#endif using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial class SortOptions { diff --git a/src/Elastic.Clients.Elasticsearch/Types/SourceConfig.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/SourceConfig.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/Types/SourceConfig.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/SourceConfig.cs index d9fdff1fba9..ca1aa59f17b 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/SourceConfig.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/SourceConfig.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else namespace Elastic.Clients.Elasticsearch.Core.Search; +#endif [JsonConverter(typeof(SourceConfigConverter))] public partial class SourceConfig diff --git a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlRow.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlRow.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch/Types/Sql/SqlRow.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlRow.cs index d002fd031d9..69376a1b646 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlRow.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlRow.cs @@ -8,7 +8,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Sql; +#else namespace Elastic.Clients.Elasticsearch.Sql; +#endif [JsonConverter(typeof(SqlRowConverter))] public sealed class SqlRow : ReadOnlyCollection diff --git a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlValue.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlValue.cs index edd5d94d6c5..28792699134 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Sql/SqlValue.cs @@ -6,7 +6,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Sql; +#else namespace Elastic.Clients.Elasticsearch.Sql; +#endif [JsonConverter(typeof(SqlValueConverter))] public readonly struct SqlValue diff --git a/src/Elastic.Clients.Elasticsearch/Types/StoredScriptId.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/StoredScriptId.cs similarity index 95% rename from src/Elastic.Clients.Elasticsearch/Types/StoredScriptId.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/StoredScriptId.cs index 22bf2195455..282c967e4e3 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/StoredScriptId.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/StoredScriptId.cs @@ -7,7 +7,11 @@ using System.Text.Json; using System.Text.Json.Serialization; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif [JsonConverter(typeof(StoredScriptIdConveter))] public partial class StoredScriptId diff --git a/src/Elastic.Clients.Elasticsearch/Types/WaitForActiveShards.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/WaitForActiveShards.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/Types/WaitForActiveShards.cs rename to src/Elastic.Clients.Elasticsearch.Shared/Types/WaitForActiveShards.cs index e033e7af327..f512efe80ee 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/WaitForActiveShards.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/WaitForActiveShards.cs @@ -4,7 +4,11 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless; +#else namespace Elastic.Clients.Elasticsearch; +#endif public partial struct WaitForActiveShards : IStringable { diff --git a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj index 48c5c3ec152..bbe4db80562 100644 --- a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj +++ b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj @@ -9,6 +9,9 @@ true README.md + + $(DefineConstants);ELASTICSEARCH_STACK + true true @@ -37,4 +40,5 @@ + \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs b/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs deleted file mode 100644 index 1476b89f690..00000000000 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs +++ /dev/null @@ -1,296 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. - - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Elastic.Transport; -using Elastic.Transport.Diagnostics.Auditing; -using Elastic.Transport.Extensions; -using Elastic.Transport.Products.Elasticsearch; -using Elastic.Clients.Elasticsearch.Core.Bulk; -using Elastic.Clients.Elasticsearch.Requests; - -namespace Elastic.Clients.Elasticsearch; - -public sealed class BulkAllObservable : IDisposable, IObservable -{ - private bool _disposedValue; - - private readonly int _backOffRetries; - private readonly TimeSpan _backOffTime; - private readonly int _bulkSize; - private readonly ElasticsearchClient _client; - - private readonly CancellationToken _compositeCancelToken; - private readonly CancellationTokenSource _compositeCancelTokenSource; - private readonly Action _droppedDocumentCallBack; - private readonly int _maxDegreeOfParallelism; - private readonly IBulkAllRequest _partitionedBulkRequest; - private readonly Func _retryPredicate; - - private readonly Action _incrementFailed = () => { }; - private readonly Action _incrementRetries = () => { }; - - private readonly Action _bulkResponseCallback; - - public BulkAllObservable(ElasticsearchClient client, IBulkAllRequest partitionedBulkRequest, CancellationToken cancellationToken = default) - { - _client = client; - _partitionedBulkRequest = partitionedBulkRequest; - _backOffRetries = _partitionedBulkRequest.BackOffRetries.GetValueOrDefault(CoordinatedRequestDefaults.BulkAllBackOffRetriesDefault); - _backOffTime = _partitionedBulkRequest?.BackOffTime?.ToTimeSpan() ?? CoordinatedRequestDefaults.BulkAllBackOffTimeDefault; - _bulkSize = _partitionedBulkRequest.Size ?? CoordinatedRequestDefaults.BulkAllSizeDefault; - _retryPredicate = _partitionedBulkRequest.RetryDocumentPredicate ?? RetryBulkActionPredicate; - _droppedDocumentCallBack = _partitionedBulkRequest.DroppedDocumentCallback ?? DroppedDocumentCallbackDefault; - _bulkResponseCallback = _partitionedBulkRequest.BulkResponseCallback; - _maxDegreeOfParallelism = _partitionedBulkRequest.MaxDegreeOfParallelism ?? CoordinatedRequestDefaults.BulkAllMaxDegreeOfParallelismDefault; - _compositeCancelTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - _compositeCancelToken = _compositeCancelTokenSource.Token; - } - - private void BulkAll(IObserver observer) - { - var documents = _partitionedBulkRequest.Documents; - var partitioned = new PartitionHelper(documents, _bulkSize); -#pragma warning disable 4014 -#pragma warning disable VSTHRD110 // Observe result of async calls - partitioned.ForEachAsync( -#pragma warning restore 4014 - (buffer, page) => BulkAsync(buffer, page, 0), - (buffer, response) => observer.OnNext(response), - ex => OnCompleted(ex, observer), - _maxDegreeOfParallelism - ); -#pragma warning restore VSTHRD110 // Observe result of async calls - } - - private void OnCompleted(Exception exception, IObserver observer) - { - if (exception != null) - observer.OnError(exception); - else - { - try - { - RefreshOnCompleted(); - observer.OnCompleted(); - } - catch (Exception e) - { - observer.OnError(e); - } - } - } - - private void RefreshOnCompleted() - { - if (!_partitionedBulkRequest.RefreshOnCompleted) - return; - - var indices = _partitionedBulkRequest.RefreshIndices ?? _partitionedBulkRequest.Index; - if (indices == null) - return; - - var rc = _partitionedBulkRequest switch - { - IHelperCallable helperCallable when helperCallable.ParentMetaData is not null => helperCallable.ParentMetaData, - _ => RequestMetaDataFactory.BulkHelperRequestMetaData(), - }; - - var request = new IndexManagement.RefreshRequest(indices); - - if (rc is not null) - request.RequestConfiguration = new RequestConfiguration { RequestMetaData = rc }; - - var refresh = _client.Indices.Refresh(request); - - if (!refresh.IsValidResponse) - throw Throw($"Refreshing after all documents have indexed failed", refresh); - } - - private async Task BulkAsync(IList buffer, long page, int backOffRetries) - { - _compositeCancelToken.ThrowIfCancellationRequested(); - - var request = _partitionedBulkRequest; - - var response = await _client.BulkAsync(s => - { - s.RequestParameters.RequestConfiguration = new RequestConfiguration { DisableAuditTrail = false }; - s.Index(request.Index); - s.Timeout(request.Timeout); - - if (request.BufferToBulk is not null) - { - request.BufferToBulk(s, buffer); - } - else - { - s.IndexMany(buffer); - } - - if (!string.IsNullOrEmpty(request.Pipeline)) - s.Pipeline(request.Pipeline); - if (request.Routing != null) - s.Routing(request.Routing); - if (request.WaitForActiveShards.HasValue) - s.WaitForActiveShards(request.WaitForActiveShards.ToString()); - - switch (_partitionedBulkRequest) - { - case IHelperCallable helperCallable when helperCallable.ParentMetaData is not null: - s.RequestConfiguration(rc => rc.RequestMetaData(helperCallable.ParentMetaData)); - break; - default: - s.RequestConfiguration(rc => rc.RequestMetaData(RequestMetaDataFactory.BulkHelperRequestMetaData())); - break; - } - - }, _compositeCancelToken).ConfigureAwait(false); - - _compositeCancelToken.ThrowIfCancellationRequested(); - _bulkResponseCallback?.Invoke(response); - - if (!response.ApiCallDetails.HasSuccessfulStatusCode || !response.ApiCallDetails.HasExpectedContentType) - return await HandleBulkRequestAsync(buffer, page, backOffRetries, response).ConfigureAwait(false); - - var retryableDocuments = new List(); - var droppedDocuments = new List>(); - - var retryableDocsRemainingAfterRetriesExceeded = false; - - foreach (var documentWithResponse in response.Items.Zip(buffer, Tuple.Create)) - { - if (documentWithResponse.Item1.IsValid) - continue; - - if (_retryPredicate(documentWithResponse.Item1, documentWithResponse.Item2)) - { - if (backOffRetries < _backOffRetries) - { - retryableDocuments.Add(documentWithResponse.Item2); - } - else - { - // We still have retriable documents but have exceeded all retries, so we mark these as - // dropped so they get handled correctly. - retryableDocsRemainingAfterRetriesExceeded = true; - droppedDocuments.Add(documentWithResponse); - } - } - else - { - droppedDocuments.Add(documentWithResponse); - } - } - - HandleDroppedDocuments(droppedDocuments, response); - - if (retryableDocsRemainingAfterRetriesExceeded) - { - throw ThrowOnBadBulk(response, $"Bulk indexing failed and after retrying {backOffRetries} times."); - } - else if (retryableDocuments.Count > 0) - { - return await RetryDocumentsAsync(page, ++backOffRetries, retryableDocuments).ConfigureAwait(false); - } - - request.BackPressure?.Release(); - - return new BulkAllResponse { Retries = backOffRetries, Page = page, Items = response.Items }; - } - - private void HandleDroppedDocuments(List> droppedDocuments, BulkResponse response) - { - if (droppedDocuments.Count <= 0) - return; - - foreach (var dropped in droppedDocuments) - _droppedDocumentCallBack(dropped.Item1, dropped.Item2); - - if (!_partitionedBulkRequest.ContinueAfterDroppedDocuments) - throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after receiving failures that can not be retried from _bulk"); - } - - private async Task HandleBulkRequestAsync(IList buffer, long page, int backOffRetries, BulkResponse response) - { - var clientException = response.ApiCallDetails.OriginalException as TransportException; - var failureReason = clientException?.FailureReason; - var reason = failureReason?.GetStringValue() ?? nameof(PipelineFailure.BadRequest); - switch (failureReason) - { - case PipelineFailure.MaxRetriesReached: - if (response.ApiCallDetails.AuditTrail.Last().Event == AuditEvent.FailedOverAllNodes) - throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after attempted bulk failed over all the active nodes"); - - ThrowOnExhaustedRetries(); - return await RetryDocumentsAsync(page, ++backOffRetries, buffer).ConfigureAwait(false); - case PipelineFailure.CouldNotStartSniffOnStartup: - case PipelineFailure.BadAuthentication: - case PipelineFailure.NoNodesAttempted: - case PipelineFailure.SniffFailure: - case PipelineFailure.Unexpected: - throw ThrowOnBadBulk(response, $"{nameof(BulkAll)} halted after {nameof(PipelineFailure)}.{reason} from _bulk"); - case PipelineFailure.BadResponse: - case PipelineFailure.PingFailure: - case PipelineFailure.MaxTimeoutReached: - case PipelineFailure.BadRequest: - default: - ThrowOnExhaustedRetries(); - return await RetryDocumentsAsync(page, ++backOffRetries, buffer).ConfigureAwait(false); - } - - void ThrowOnExhaustedRetries() - { - if (backOffRetries < _backOffRetries) - return; - - throw ThrowOnBadBulk(response, - $"{nameof(BulkAll)} halted after {nameof(PipelineFailure)}.{reason} from _bulk and exhausting retries ({backOffRetries})"); - } - } - - private async Task RetryDocumentsAsync(long page, int backOffRetries, IList retryDocuments) - { - _incrementRetries(); - await Task.Delay(_backOffTime, _compositeCancelToken).ConfigureAwait(false); - return await BulkAsync(retryDocuments, page, backOffRetries).ConfigureAwait(false); - } - - private Exception ThrowOnBadBulk(ElasticsearchResponse response, string message) - { - _incrementFailed(); - _partitionedBulkRequest.BackPressure?.Release(); - return Throw(message, response); - } - - private static bool RetryBulkActionPredicate(ResponseItem bulkResponseItem, T d) => bulkResponseItem.Status == 429; - - private static void DroppedDocumentCallbackDefault(ResponseItem bulkResponseItem, T d) { } - - public void Dispose() - { - if (!_disposedValue) - { - _compositeCancelTokenSource?.Cancel(); - _compositeCancelTokenSource?.Dispose(); - - _disposedValue = true; - } - } - - public IDisposable Subscribe(IObserver observer) - { - observer.ThrowIfNull(nameof(observer)); - BulkAll(observer); - return this; - } - - private static TransportException Throw(string message, ElasticsearchResponse details) => - new(PipelineFailure.BadResponse, message, details); -} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs index 8abef9cad8e..7ad07ae169e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs @@ -38,7 +38,7 @@ internal AsyncSearchNamespacedClient(ElasticsearchClient client) : base(client) /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request) { @@ -48,7 +48,7 @@ public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(AsyncSearchStatusRequest request, CancellationToken cancellationToken = default) { @@ -58,7 +58,7 @@ public virtual Task StatusAsync(AsyncSearchStatusRequ /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id id) { @@ -69,7 +69,7 @@ public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequestDescriptor descriptor) { @@ -79,7 +79,7 @@ public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequestDescript /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { @@ -91,7 +91,7 @@ public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequestDescriptor descriptor) { @@ -101,7 +101,7 @@ public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequ /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { @@ -113,7 +113,7 @@ public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elast /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -124,7 +124,7 @@ public virtual Task StatusAsync(Elastic.Clients.Elast /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -134,7 +134,7 @@ public virtual Task StatusAsync(AsyncSearchStatusRequ /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Task StatusAsync(Elastic.Clients.Elast /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -156,7 +156,7 @@ public virtual Task StatusAsync(AsyncSearc /// /// Retrieves the status of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -168,7 +168,7 @@ public virtual Task StatusAsync(Elastic.Cl /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request) { @@ -178,7 +178,7 @@ public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(DeleteAsyncSearchRequest request, CancellationToken cancellationToken = default) { @@ -188,7 +188,7 @@ public virtual Task DeleteAsync(DeleteAsyncSearchRequ /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id) { @@ -199,7 +199,7 @@ public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescriptor descriptor) { @@ -209,7 +209,7 @@ public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescript /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { @@ -221,7 +221,7 @@ public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescriptor descriptor) { @@ -231,7 +231,7 @@ public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequ /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { @@ -243,7 +243,7 @@ public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elast /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -254,7 +254,7 @@ public virtual Task DeleteAsync(Elastic.Clients.Elast /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(DeleteAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -264,7 +264,7 @@ public virtual Task DeleteAsync(DeleteAsyncSearchRequ /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -276,7 +276,7 @@ public virtual Task DeleteAsync(Elastic.Clients.Elast /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(DeleteAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -286,7 +286,7 @@ public virtual Task DeleteAsync(DeleteAsyn /// /// Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -298,7 +298,7 @@ public virtual Task DeleteAsync(Elastic.Cl /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequest request) { @@ -308,7 +308,7 @@ public virtual GetAsyncSearchResponse Get(GetAsyncSearchRe /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(GetAsyncSearchRequest request, CancellationToken cancellationToken = default) { @@ -318,7 +318,7 @@ public virtual Task> GetAsync(GetAs /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id) { @@ -329,7 +329,7 @@ public virtual GetAsyncSearchResponse Get(Elastic.Clients. /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) { @@ -339,7 +339,7 @@ public virtual GetAsyncSearchResponse Get(GetAsyncSearchRe /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { @@ -351,7 +351,7 @@ public virtual GetAsyncSearchResponse Get(Elastic.Clients. /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -362,7 +362,7 @@ public virtual Task> GetAsync(Elast /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -372,7 +372,7 @@ public virtual Task> GetAsync(GetAs /// /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -384,7 +384,7 @@ public virtual Task> GetAsync(Elast /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequest request) { @@ -394,7 +394,7 @@ public virtual SubmitAsyncSearchResponse Submit(SubmitAsyn /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> SubmitAsync(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default) { @@ -404,7 +404,7 @@ public virtual Task> SubmitAsync /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SubmitAsyncSearchResponse Submit() { @@ -415,7 +415,7 @@ public virtual SubmitAsyncSearchResponse Submit() /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequestDescriptor descriptor) { @@ -425,7 +425,7 @@ public virtual SubmitAsyncSearchResponse Submit(SubmitAsyn /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SubmitAsyncSearchResponse Submit(Action> configureRequest) { @@ -437,7 +437,7 @@ public virtual SubmitAsyncSearchResponse Submit(Action /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> SubmitAsync(CancellationToken cancellationToken = default) { @@ -448,7 +448,7 @@ public virtual Task> SubmitAsync /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> SubmitAsync(SubmitAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -458,7 +458,7 @@ public virtual Task> SubmitAsync /// /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> SubmitAsync(Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs index 59b577d8bdc..0b7ab27caf5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs @@ -38,7 +38,7 @@ internal ClusterNamespacedClient(ElasticsearchClient client) : base(client) /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequest request) { @@ -48,7 +48,7 @@ public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequ /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task AllocationExplainAsync(AllocationExplainRequest request, CancellationToken cancellationToken = default) { @@ -58,7 +58,7 @@ public virtual Task AllocationExplainAsync(Allocation /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AllocationExplainResponse AllocationExplain() { @@ -69,7 +69,7 @@ public virtual AllocationExplainResponse AllocationExplain() /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequestDescriptor descriptor) { @@ -79,7 +79,7 @@ public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequ /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual AllocationExplainResponse AllocationExplain(Action configureRequest) { @@ -91,7 +91,7 @@ public virtual AllocationExplainResponse AllocationExplain(Action /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task AllocationExplainAsync(CancellationToken cancellationToken = default) { @@ -102,7 +102,7 @@ public virtual Task AllocationExplainAsync(Cancellati /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task AllocationExplainAsync(AllocationExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -112,7 +112,7 @@ public virtual Task AllocationExplainAsync(Allocation /// /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task AllocationExplainAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -124,7 +124,7 @@ public virtual Task AllocationExplainAsync(Action /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) { @@ -134,7 +134,7 @@ public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatsAsync(ClusterStatsRequest request, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Task StatsAsync(ClusterStatsRequest request /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClusterStatsResponse Stats() { @@ -155,7 +155,7 @@ public virtual ClusterStatsResponse Stats() /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClusterStatsResponse Stats(ClusterStatsRequestDescriptor descriptor) { @@ -165,7 +165,7 @@ public virtual ClusterStatsResponse Stats(ClusterStatsRequestDescriptor descript /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClusterStatsResponse Stats(Action configureRequest) { @@ -177,7 +177,7 @@ public virtual ClusterStatsResponse Stats(Action /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatsAsync(CancellationToken cancellationToken = default) { @@ -188,7 +188,7 @@ public virtual Task StatsAsync(CancellationToken cancellat /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatsAsync(ClusterStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Task StatsAsync(ClusterStatsRequestDescript /// /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -210,7 +210,7 @@ public virtual Task StatsAsync(Action /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequest request) { @@ -220,7 +220,7 @@ public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequest /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetSettingsAsync(GetClusterSettingsRequest request, CancellationToken cancellationToken = default) { @@ -230,7 +230,7 @@ public virtual Task GetSettingsAsync(GetClusterSetti /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetClusterSettingsResponse GetSettings() { @@ -241,7 +241,7 @@ public virtual GetClusterSettingsResponse GetSettings() /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequestDescriptor descriptor) { @@ -251,7 +251,7 @@ public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequestD /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetClusterSettingsResponse GetSettings(Action configureRequest) { @@ -263,7 +263,7 @@ public virtual GetClusterSettingsResponse GetSettings(Action /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetSettingsAsync(CancellationToken cancellationToken = default) { @@ -274,7 +274,7 @@ public virtual Task GetSettingsAsync(CancellationTok /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetSettingsAsync(GetClusterSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -284,7 +284,7 @@ public virtual Task GetSettingsAsync(GetClusterSetti /// /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetSettingsAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -296,7 +296,7 @@ public virtual Task GetSettingsAsync(Action /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health(HealthRequest request) { @@ -306,7 +306,7 @@ public virtual HealthResponse Health(HealthRequest request) /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(HealthRequest request, CancellationToken cancellationToken = default) { @@ -316,7 +316,7 @@ public virtual Task HealthAsync(HealthRequest request, Cancellat /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health() { @@ -327,7 +327,7 @@ public virtual HealthResponse Health() /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health(HealthRequestDescriptor descriptor) { @@ -337,7 +337,7 @@ public virtual HealthResponse Health(HealthRequestDescriptor descriptor) /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health(Action configureRequest) { @@ -349,7 +349,7 @@ public virtual HealthResponse Health(Action configureRe /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health(HealthRequestDescriptor descriptor) { @@ -359,7 +359,7 @@ public virtual HealthResponse Health(HealthRequestDescriptor /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual HealthResponse Health(Action> configureRequest) { @@ -371,7 +371,7 @@ public virtual HealthResponse Health(Action /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(CancellationToken cancellationToken = default) { @@ -382,7 +382,7 @@ public virtual Task HealthAsync(CancellationToken cancellationTo /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -392,7 +392,7 @@ public virtual Task HealthAsync(HealthRequestDescriptor descript /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -404,7 +404,7 @@ public virtual Task HealthAsync(Action /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -414,7 +414,7 @@ public virtual Task HealthAsync(HealthRequestDescript /// /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task HealthAsync(Action> configureRequest, CancellationToken cancellationToken = default) { @@ -426,7 +426,7 @@ public virtual Task HealthAsync(Action /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PendingTasksResponse PendingTasks(PendingTasksRequest request) { @@ -436,7 +436,7 @@ public virtual PendingTasksResponse PendingTasks(PendingTasksRequest request) /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PendingTasksAsync(PendingTasksRequest request, CancellationToken cancellationToken = default) { @@ -446,7 +446,7 @@ public virtual Task PendingTasksAsync(PendingTasksRequest /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PendingTasksResponse PendingTasks() { @@ -457,7 +457,7 @@ public virtual PendingTasksResponse PendingTasks() /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PendingTasksResponse PendingTasks(PendingTasksRequestDescriptor descriptor) { @@ -467,7 +467,7 @@ public virtual PendingTasksResponse PendingTasks(PendingTasksRequestDescriptor d /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PendingTasksResponse PendingTasks(Action configureRequest) { @@ -479,7 +479,7 @@ public virtual PendingTasksResponse PendingTasks(Action /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PendingTasksAsync(CancellationToken cancellationToken = default) { @@ -490,7 +490,7 @@ public virtual Task PendingTasksAsync(CancellationToken ca /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PendingTasksAsync(PendingTasksRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -500,7 +500,7 @@ public virtual Task PendingTasksAsync(PendingTasksRequestD /// /// Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PendingTasksAsync(Action configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs index c8c7f00bf54..c723a56db96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs @@ -210,7 +210,7 @@ public virtual Task StatsAsync(Action /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequest request) { @@ -220,7 +220,7 @@ public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequest request) /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExecutePolicyAsync(ExecutePolicyRequest request, CancellationToken cancellationToken = default) { @@ -230,7 +230,7 @@ public virtual Task ExecutePolicyAsync(ExecutePolicyReque /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Name name) { @@ -241,7 +241,7 @@ public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequestDescriptor descriptor) { @@ -251,7 +251,7 @@ public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequestDescripto /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { @@ -263,7 +263,7 @@ public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) { @@ -274,7 +274,7 @@ public virtual Task ExecutePolicyAsync(Elastic.Clients.El /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExecutePolicyAsync(ExecutePolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -284,7 +284,7 @@ public virtual Task ExecutePolicyAsync(ExecutePolicyReque /// /// Creates the enrich index for an existing enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { @@ -382,7 +382,7 @@ public virtual Task GetPolicyAsync(Action /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PutPolicyResponse PutPolicy(PutPolicyRequest request) { @@ -392,7 +392,7 @@ public virtual PutPolicyResponse PutPolicy(PutPolicyRequest request) /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPolicyAsync(PutPolicyRequest request, CancellationToken cancellationToken = default) { @@ -402,7 +402,7 @@ public virtual Task PutPolicyAsync(PutPolicyRequest request, /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) { @@ -412,7 +412,7 @@ public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { @@ -424,7 +424,7 @@ public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name na /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) { @@ -434,7 +434,7 @@ public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { @@ -446,7 +446,7 @@ public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsea /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -456,7 +456,7 @@ public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { @@ -468,7 +468,7 @@ public virtual Task PutPolicyAsync(Elastic.Clients.Elasticsea /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -478,7 +478,7 @@ public virtual Task PutPolicyAsync(PutPolicyReques /// /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs index bcdacac136b..89ba4e1262c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs @@ -168,7 +168,7 @@ public virtual Task DeleteAsync(Elastic.Clients.El /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual EqlGetResponse Get(EqlGetRequest request) { @@ -178,7 +178,7 @@ public virtual EqlGetResponse Get(EqlGetRequest request) /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(EqlGetRequest request, CancellationToken cancellationToken = default) { @@ -188,7 +188,7 @@ public virtual Task> GetAsync(EqlGetRequest reque /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Id id) { @@ -199,7 +199,7 @@ public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch. /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual EqlGetResponse Get(EqlGetRequestDescriptor descriptor) { @@ -209,7 +209,7 @@ public virtual EqlGetResponse Get(EqlGetRequestDescriptor descri /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { @@ -221,7 +221,7 @@ public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch. /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -232,7 +232,7 @@ public virtual Task> GetAsync(Elastic.Clients.Ela /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(EqlGetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -242,7 +242,7 @@ public virtual Task> GetAsync(EqlGetRequestDescri /// /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -340,7 +340,7 @@ public virtual Task> SearchAsync(Elastic.Clien /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequest request) { @@ -350,7 +350,7 @@ public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequest request) /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(GetEqlStatusRequest request, CancellationToken cancellationToken = default) { @@ -360,7 +360,7 @@ public virtual Task GetStatusAsync(GetEqlStatusRequest req /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id) { @@ -371,7 +371,7 @@ public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id i /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) { @@ -381,7 +381,7 @@ public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor desc /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { @@ -393,7 +393,7 @@ public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id i /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) { @@ -403,7 +403,7 @@ public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDesc /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { @@ -415,7 +415,7 @@ public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elastic /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -426,7 +426,7 @@ public virtual Task GetStatusAsync(Elastic.Clients.Elastic /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -436,7 +436,7 @@ public virtual Task GetStatusAsync(GetEqlStatusRequestDesc /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -448,7 +448,7 @@ public virtual Task GetStatusAsync(Elastic.Clients.Elastic /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -458,7 +458,7 @@ public virtual Task GetStatusAsync(GetEqlStatus /// /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs index 59ce7000e2f..19b62fff305 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs @@ -38,7 +38,7 @@ internal GraphNamespacedClient(ElasticsearchClient client) : base(client) /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(ExploreRequest request) { @@ -48,7 +48,7 @@ public virtual ExploreResponse Explore(ExploreRequest request) /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(ExploreRequest request, CancellationToken cancellationToken = default) { @@ -58,7 +58,7 @@ public virtual Task ExploreAsync(ExploreRequest request, Cancel /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices) { @@ -69,7 +69,7 @@ public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices ind /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) { @@ -79,7 +79,7 @@ public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { @@ -91,7 +91,7 @@ public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices ind /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) { @@ -101,7 +101,7 @@ public virtual ExploreResponse Explore(ExploreRequestDescriptor /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { @@ -113,7 +113,7 @@ public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch. /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { @@ -124,7 +124,7 @@ public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch. /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(ExploreRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -134,7 +134,7 @@ public virtual Task ExploreAsync(ExploreRequestDescriptor descr /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch. /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(ExploreRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -156,7 +156,7 @@ public virtual Task ExploreAsync(ExploreRequestDescr /// /// Explore extracted and summarized information about the documents and terms in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs index e89cf8966fd..0b53126beaa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -214,7 +214,7 @@ public virtual Task CloneAsync(Elastic.Clients.El /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(CloseIndexRequest request) { @@ -224,7 +224,7 @@ public virtual CloseIndexResponse Close(CloseIndexRequest request) /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) { @@ -234,7 +234,7 @@ public virtual Task CloseAsync(CloseIndexRequest request, Ca /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices) { @@ -245,7 +245,7 @@ public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices in /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) { @@ -255,7 +255,7 @@ public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { @@ -267,7 +267,7 @@ public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices in /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) { @@ -277,7 +277,7 @@ public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { @@ -289,7 +289,7 @@ public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { @@ -300,7 +300,7 @@ public virtual Task CloseAsync(Elastic.Clients.Elasticsearch /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -310,7 +310,7 @@ public virtual Task CloseAsync(CloseIndexRequestDescriptor d /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { @@ -322,7 +322,7 @@ public virtual Task CloseAsync(Elastic.Clients.Elasticsearch /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -332,7 +332,7 @@ public virtual Task CloseAsync(CloseIndexRequestD /// /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -430,7 +430,7 @@ public virtual Task CreateDataStreamAsync(Elastic.Clie /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(CreateIndexRequest request) { @@ -440,7 +440,7 @@ public virtual CreateIndexResponse Create(CreateIndexRequest request) /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(CreateIndexRequest request, CancellationToken cancellationToken = default) { @@ -450,7 +450,7 @@ public virtual Task CreateAsync(CreateIndexRequest request, /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index) { @@ -461,7 +461,7 @@ public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexNam /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) { @@ -471,7 +471,7 @@ public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descripto /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) { @@ -483,7 +483,7 @@ public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexNam /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create() { @@ -494,7 +494,7 @@ public virtual CreateIndexResponse Create() /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(Action> configureRequest) { @@ -506,7 +506,7 @@ public virtual CreateIndexResponse Create(Action /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) { @@ -516,7 +516,7 @@ public virtual CreateIndexResponse Create(CreateIndexRequestDescripto /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { @@ -528,7 +528,7 @@ public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsear /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { @@ -539,7 +539,7 @@ public virtual Task CreateAsync(Elastic.Clients.Elasticsear /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -549,7 +549,7 @@ public virtual Task CreateAsync(CreateIndexRequestDescripto /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) { @@ -561,7 +561,7 @@ public virtual Task CreateAsync(Elastic.Clients.Elasticsear /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(CancellationToken cancellationToken = default) { @@ -572,7 +572,7 @@ public virtual Task CreateAsync(CancellationToke /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(Action> configureRequest, CancellationToken cancellationToken = default) { @@ -584,7 +584,7 @@ public virtual Task CreateAsync(Action /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -594,7 +594,7 @@ public virtual Task CreateAsync(CreateIndexReque /// /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -1792,7 +1792,7 @@ public virtual Task ExplainDataLifecycleAsync /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush(FlushRequest request) { @@ -1802,7 +1802,7 @@ public virtual FlushResponse Flush(FlushRequest request) /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(FlushRequest request, CancellationToken cancellationToken = default) { @@ -1812,7 +1812,7 @@ public virtual Task FlushAsync(FlushRequest request, Cancellation /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush() { @@ -1823,7 +1823,7 @@ public virtual FlushResponse Flush() /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) { @@ -1833,7 +1833,7 @@ public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush(Action configureRequest) { @@ -1845,7 +1845,7 @@ public virtual FlushResponse Flush(Action configureReque /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) { @@ -1855,7 +1855,7 @@ public virtual FlushResponse Flush(FlushRequestDescriptor /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual FlushResponse Flush(Action> configureRequest) { @@ -1867,7 +1867,7 @@ public virtual FlushResponse Flush(Action /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(CancellationToken cancellationToken = default) { @@ -1878,7 +1878,7 @@ public virtual Task FlushAsync(CancellationToken cancellationToke /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -1888,7 +1888,7 @@ public virtual Task FlushAsync(FlushRequestDescriptor descriptor, /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -1900,7 +1900,7 @@ public virtual Task FlushAsync(Action con /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -1910,7 +1910,7 @@ public virtual Task FlushAsync(FlushRequestDescriptor< /// /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task FlushAsync(Action> configureRequest, CancellationToken cancellationToken = default) { @@ -3904,7 +3904,7 @@ public virtual Task RefreshAsync(Action /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual RolloverResponse Rollover(RolloverRequest request) { @@ -3914,7 +3914,7 @@ public virtual RolloverResponse Rollover(RolloverRequest request) /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task RolloverAsync(RolloverRequest request, CancellationToken cancellationToken = default) { @@ -3924,7 +3924,7 @@ public virtual Task RolloverAsync(RolloverRequest request, Can /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias) { @@ -3935,7 +3935,7 @@ public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlia /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) { @@ -3945,7 +3945,7 @@ public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest) { @@ -3957,7 +3957,7 @@ public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlia /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, CancellationToken cancellationToken = default) { @@ -3968,7 +3968,7 @@ public virtual Task RolloverAsync(Elastic.Clients.Elasticsearc /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -3978,7 +3978,7 @@ public virtual Task RolloverAsync(RolloverRequestDescriptor de /// /// Updates an alias to point to a new index when the existing index
is considered to be too large or too old.
- /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest, CancellationToken cancellationToken = default) { @@ -3990,7 +3990,7 @@ public virtual Task RolloverAsync(Elastic.Clients.Elasticsearc /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequest request) { @@ -4000,7 +4000,7 @@ public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequest request) /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(ShrinkIndexRequest request, CancellationToken cancellationToken = default) { @@ -4010,7 +4010,7 @@ public virtual Task ShrinkAsync(ShrinkIndexRequest request, /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target) { @@ -4021,7 +4021,7 @@ public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexNam /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescriptor descriptor) { @@ -4031,7 +4031,7 @@ public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescriptor descripto /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest) { @@ -4043,7 +4043,7 @@ public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexNam /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName target) { @@ -4054,7 +4054,7 @@ public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsear /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { @@ -4066,7 +4066,7 @@ public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsear /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescriptor descriptor) { @@ -4076,7 +4076,7 @@ public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescripto /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { @@ -4088,7 +4088,7 @@ public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsear /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) { @@ -4099,7 +4099,7 @@ public virtual Task ShrinkAsync(Elastic.Clients.Elasticsear /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(ShrinkIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -4109,7 +4109,7 @@ public virtual Task ShrinkAsync(ShrinkIndexRequestDescripto /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest, CancellationToken cancellationToken = default) { @@ -4121,7 +4121,7 @@ public virtual Task ShrinkAsync(Elastic.Clients.Elasticsear /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) { @@ -4132,7 +4132,7 @@ public virtual Task ShrinkAsync(Elastic.Clients. /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -4144,7 +4144,7 @@ public virtual Task ShrinkAsync(Elastic.Clients. /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(ShrinkIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -4154,7 +4154,7 @@ public virtual Task ShrinkAsync(ShrinkIndexReque /// /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -4382,7 +4382,7 @@ public virtual Task SimulateTemplateAsync(Action /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(SplitIndexRequest request) { @@ -4392,7 +4392,7 @@ public virtual SplitIndexResponse Split(SplitIndexRequest request) /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(SplitIndexRequest request, CancellationToken cancellationToken = default) { @@ -4402,7 +4402,7 @@ public virtual Task SplitAsync(SplitIndexRequest request, Ca /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target) { @@ -4413,7 +4413,7 @@ public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor descriptor) { @@ -4423,7 +4423,7 @@ public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor descriptor) /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest) { @@ -4435,7 +4435,7 @@ public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName target) { @@ -4446,7 +4446,7 @@ public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { @@ -4458,7 +4458,7 @@ public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor descriptor) { @@ -4468,7 +4468,7 @@ public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { @@ -4480,7 +4480,7 @@ public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) { @@ -4491,7 +4491,7 @@ public virtual Task SplitAsync(Elastic.Clients.Elasticsearch /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(SplitIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -4501,7 +4501,7 @@ public virtual Task SplitAsync(SplitIndexRequestDescriptor d /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest, CancellationToken cancellationToken = default) { @@ -4513,7 +4513,7 @@ public virtual Task SplitAsync(Elastic.Clients.Elasticsearch /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) { @@ -4524,7 +4524,7 @@ public virtual Task SplitAsync(Elastic.Clients.El /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -4536,7 +4536,7 @@ public virtual Task SplitAsync(Elastic.Clients.El /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(SplitIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -4546,7 +4546,7 @@ public virtual Task SplitAsync(SplitIndexRequestD /// /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs index da837c55f3a..7ca60191308 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -168,7 +168,7 @@ public virtual Task DeletePipelineAsync(Elast /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequest request) { @@ -178,7 +178,7 @@ public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequest request) /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GeoIpStatsAsync(GeoIpStatsRequest request, CancellationToken cancellationToken = default) { @@ -188,7 +188,7 @@ public virtual Task GeoIpStatsAsync(GeoIpStatsRequest reques /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats() { @@ -199,7 +199,7 @@ public virtual GeoIpStatsResponse GeoIpStats() /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequestDescriptor descriptor) { @@ -209,7 +209,7 @@ public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequestDescriptor descrip /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats(Action configureRequest) { @@ -221,7 +221,7 @@ public virtual GeoIpStatsResponse GeoIpStats(Action /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GeoIpStatsAsync(CancellationToken cancellationToken = default) { @@ -232,7 +232,7 @@ public virtual Task GeoIpStatsAsync(CancellationToken cancel /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GeoIpStatsAsync(GeoIpStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -242,7 +242,7 @@ public virtual Task GeoIpStatsAsync(GeoIpStatsRequestDescrip /// /// Returns statistical information about geoip databases - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GeoIpStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -384,7 +384,7 @@ public virtual Task GetPipelineAsync(Action /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequest request) { @@ -394,7 +394,7 @@ public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequest request) /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ProcessorGrokAsync(ProcessorGrokRequest request, CancellationToken cancellationToken = default) { @@ -404,7 +404,7 @@ public virtual Task ProcessorGrokAsync(ProcessorGrokReque /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok() { @@ -415,7 +415,7 @@ public virtual ProcessorGrokResponse ProcessorGrok() /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequestDescriptor descriptor) { @@ -425,7 +425,7 @@ public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequestDescripto /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok(Action configureRequest) { @@ -437,7 +437,7 @@ public virtual ProcessorGrokResponse ProcessorGrok(Action /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ProcessorGrokAsync(CancellationToken cancellationToken = default) { @@ -448,7 +448,7 @@ public virtual Task ProcessorGrokAsync(CancellationToken /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ProcessorGrokAsync(ProcessorGrokRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -458,7 +458,7 @@ public virtual Task ProcessorGrokAsync(ProcessorGrokReque /// /// Returns a list of the built-in patterns. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ProcessorGrokAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -470,7 +470,7 @@ public virtual Task ProcessorGrokAsync(Action /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPipelineResponse PutPipeline(PutPipelineRequest request) { @@ -480,7 +480,7 @@ public virtual PutPipelineResponse PutPipeline(PutPipelineRequest request) /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(PutPipelineRequest request, CancellationToken cancellationToken = default) { @@ -490,7 +490,7 @@ public virtual Task PutPipelineAsync(PutPipelineRequest req /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) { @@ -500,7 +500,7 @@ public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor desc /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { @@ -512,7 +512,7 @@ public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) { @@ -522,7 +522,7 @@ public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDesc /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { @@ -534,7 +534,7 @@ public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasti /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(PutPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -544,7 +544,7 @@ public virtual Task PutPipelineAsync(PutPipelineRequestDesc /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -556,7 +556,7 @@ public virtual Task PutPipelineAsync(Elastic.Clients.Elasti /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(PutPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -566,7 +566,7 @@ public virtual Task PutPipelineAsync(PutPipeline /// /// Creates or updates a pipeline. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs index 941cba1eb9e..ebe2e5ec8c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs @@ -39,7 +39,7 @@ internal TasksNamespacedClient(ElasticsearchClient client) : base(client) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CancelResponse Cancel(CancelRequest request) { @@ -50,7 +50,7 @@ public virtual CancelResponse Cancel(CancelRequest request) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CancelAsync(CancelRequest request, CancellationToken cancellationToken = default) { @@ -61,7 +61,7 @@ public virtual Task CancelAsync(CancelRequest request, Cancellat /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CancelResponse Cancel() { @@ -73,7 +73,7 @@ public virtual CancelResponse Cancel() /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CancelResponse Cancel(CancelRequestDescriptor descriptor) { @@ -84,7 +84,7 @@ public virtual CancelResponse Cancel(CancelRequestDescriptor descriptor) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual CancelResponse Cancel(Action configureRequest) { @@ -97,7 +97,7 @@ public virtual CancelResponse Cancel(Action configureRe /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CancelAsync(CancellationToken cancellationToken = default) { @@ -109,7 +109,7 @@ public virtual Task CancelAsync(CancellationToken cancellationTo /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CancelAsync(CancelRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -120,7 +120,7 @@ public virtual Task CancelAsync(CancelRequestDescriptor descript /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Cancels a task, if it can be cancelled through an API. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task CancelAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -133,7 +133,7 @@ public virtual Task CancelAsync(Action /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetTasksResponse Get(GetTasksRequest request) { @@ -144,7 +144,7 @@ public virtual GetTasksResponse Get(GetTasksRequest request) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetAsync(GetTasksRequest request, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual Task GetAsync(GetTasksRequest request, Cancella /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id task_id) { @@ -167,7 +167,7 @@ public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id task_id) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetTasksResponse Get(GetTasksRequestDescriptor descriptor) { @@ -178,7 +178,7 @@ public virtual GetTasksResponse Get(GetTasksRequestDescriptor descriptor) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest) { @@ -191,7 +191,7 @@ public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id task_id, Ac /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id task_id, CancellationToken cancellationToken = default) { @@ -203,7 +203,7 @@ public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetAsync(GetTasksRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -214,7 +214,7 @@ public virtual Task GetAsync(GetTasksRequestDescriptor descrip /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -227,7 +227,7 @@ public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ListResponse List(ListRequest request) { @@ -238,7 +238,7 @@ public virtual ListResponse List(ListRequest request) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ListAsync(ListRequest request, CancellationToken cancellationToken = default) { @@ -249,7 +249,7 @@ public virtual Task ListAsync(ListRequest request, CancellationTok /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ListResponse List() { @@ -261,7 +261,7 @@ public virtual ListResponse List() /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ListResponse List(ListRequestDescriptor descriptor) { @@ -272,7 +272,7 @@ public virtual ListResponse List(ListRequestDescriptor descriptor) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ListResponse List(Action configureRequest) { @@ -285,7 +285,7 @@ public virtual ListResponse List(Action configureRequest) /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ListAsync(CancellationToken cancellationToken = default) { @@ -297,7 +297,7 @@ public virtual Task ListAsync(CancellationToken cancellationToken /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ListAsync(ListRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -308,7 +308,7 @@ public virtual Task ListAsync(ListRequestDescriptor descriptor, Ca /// /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ListAsync(Action configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 09fb77a6c46..83e2a2a383d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -53,7 +53,7 @@ private partial void SetupNamespaces() /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual BulkResponse Bulk(BulkRequest request) { @@ -63,7 +63,7 @@ public virtual BulkResponse Bulk(BulkRequest request) /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(BulkRequest request, CancellationToken cancellationToken = default) { @@ -73,7 +73,7 @@ public virtual Task BulkAsync(BulkRequest request, CancellationTok /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) { @@ -83,7 +83,7 @@ public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual BulkResponse Bulk(Action configureRequest) { @@ -95,7 +95,7 @@ public virtual BulkResponse Bulk(Action configureRequest) /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) { @@ -105,7 +105,7 @@ public virtual BulkResponse Bulk(BulkRequestDescriptor des /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual BulkResponse Bulk(Action> configureRequest) { @@ -117,7 +117,7 @@ public virtual BulkResponse Bulk(Action /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(BulkRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -127,7 +127,7 @@ public virtual Task BulkAsync(BulkRequestDescriptor descriptor, Ca /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -139,7 +139,7 @@ public virtual Task BulkAsync(Action config /// /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(BulkRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Task BulkAsync(BulkRequestDescriptor /// Allows to perform multiple index/update/delete operations in a single request. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(Action> configureRequest, CancellationToken cancellationToken = default) { @@ -161,7 +161,7 @@ public virtual Task BulkAsync(Action /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClearScrollResponse ClearScroll(ClearScrollRequest request) { @@ -171,7 +171,7 @@ public virtual ClearScrollResponse ClearScroll(ClearScrollRequest request) /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClearScrollAsync(ClearScrollRequest request, CancellationToken cancellationToken = default) { @@ -181,7 +181,7 @@ public virtual Task ClearScrollAsync(ClearScrollRequest req /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClearScrollResponse ClearScroll() { @@ -192,7 +192,7 @@ public virtual ClearScrollResponse ClearScroll() /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClearScrollResponse ClearScroll(ClearScrollRequestDescriptor descriptor) { @@ -202,7 +202,7 @@ public virtual ClearScrollResponse ClearScroll(ClearScrollRequestDescriptor desc /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClearScrollResponse ClearScroll(Action configureRequest) { @@ -214,7 +214,7 @@ public virtual ClearScrollResponse ClearScroll(Action /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClearScrollAsync(CancellationToken cancellationToken = default) { @@ -225,7 +225,7 @@ public virtual Task ClearScrollAsync(CancellationToken canc /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClearScrollAsync(ClearScrollRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -235,7 +235,7 @@ public virtual Task ClearScrollAsync(ClearScrollRequestDesc /// /// Explicitly clears the search context for a scroll. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClearScrollAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -247,7 +247,7 @@ public virtual Task ClearScrollAsync(Action /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequest request) { @@ -257,7 +257,7 @@ public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequest /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClosePointInTimeAsync(ClosePointInTimeRequest request, CancellationToken cancellationToken = default) { @@ -267,7 +267,7 @@ public virtual Task ClosePointInTimeAsync(ClosePointIn /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClosePointInTimeResponse ClosePointInTime() { @@ -278,7 +278,7 @@ public virtual ClosePointInTimeResponse ClosePointInTime() /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequestDescriptor descriptor) { @@ -288,7 +288,7 @@ public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequest /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ClosePointInTimeResponse ClosePointInTime(Action configureRequest) { @@ -300,7 +300,7 @@ public virtual ClosePointInTimeResponse ClosePointInTime(Action /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClosePointInTimeAsync(CancellationToken cancellationToken = default) { @@ -311,7 +311,7 @@ public virtual Task ClosePointInTimeAsync(Cancellation /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClosePointInTimeAsync(ClosePointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -321,7 +321,7 @@ public virtual Task ClosePointInTimeAsync(ClosePointIn /// /// Close a point in time - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClosePointInTimeAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -2801,7 +2801,7 @@ public virtual Task MultiTermVectorsAsync(A /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequest request) { @@ -2811,7 +2811,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequest re /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequest request, CancellationToken cancellationToken = default) { @@ -2821,7 +2821,7 @@ public virtual Task OpenPointInTimeAsync(OpenPointInTim /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Indices indices) { @@ -2832,7 +2832,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticse /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) { @@ -2842,7 +2842,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDes /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { @@ -2854,7 +2854,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticse /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) { @@ -2864,7 +2864,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTim /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { @@ -2876,7 +2876,7 @@ public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Client /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { @@ -2887,7 +2887,7 @@ public virtual Task OpenPointInTimeAsync(Elastic.Client /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -2897,7 +2897,7 @@ public virtual Task OpenPointInTimeAsync(OpenPointInTim /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { @@ -2909,7 +2909,7 @@ public virtual Task OpenPointInTimeAsync(Elastic.Client /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -2919,7 +2919,7 @@ public virtual Task OpenPointInTimeAsync(Ope /// /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Playground/Playground.csproj b/src/Playground/Playground.csproj index b64fb542d90..2af9e0a45ae 100644 --- a/src/Playground/Playground.csproj +++ b/src/Playground/Playground.csproj @@ -1,4 +1,4 @@ - + Exe @@ -10,10 +10,12 @@ + + diff --git a/src/Playground/packages.lock.json b/src/Playground/packages.lock.json index e7b50fb9e24..67b696921d6 100644 --- a/src/Playground/packages.lock.json +++ b/src/Playground/packages.lock.json @@ -14,6 +14,12 @@ "Microsoft.SourceLink.GitLab": "1.1.1" } }, + "Elastic.Transport": { + "type": "Direct", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==" + }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", "requested": "[1.0.3, )", @@ -46,11 +52,6 @@ "System.Diagnostics.EventLog": "6.0.0" } }, - "Elastic.Transport": { - "type": "Transitive", - "resolved": "0.4.16", - "contentHash": "O2LHqnQTWAF0+cic9zYkZJ8m95cG9AnkRbwkRZogroWXZHh8oY5ewVsQsF+wwNHs/YWnNIBTq/7yqaFklBB/Wg==" - }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", "resolved": "1.1.1", @@ -119,6 +120,12 @@ "Elastic.Clients.Elasticsearch": "[8.0.0, )", "Newtonsoft.Json": "[13.0.1, )" } + }, + "elastic.clients.elasticsearch.serverless": { + "type": "Project", + "dependencies": { + "Elastic.Transport": "[0.4.16, )" + } } } } diff --git a/tests/Tests/Tests.csproj b/tests/Tests/Tests.csproj index dda65c10978..710f08bb087 100644 --- a/tests/Tests/Tests.csproj +++ b/tests/Tests/Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Tests/packages.lock.json b/tests/Tests/packages.lock.json index 4ed8283d5d4..198e548e01a 100644 --- a/tests/Tests/packages.lock.json +++ b/tests/Tests/packages.lock.json @@ -31,11 +31,11 @@ }, "Elastic.Transport.VirtualizedCluster": { "type": "Direct", - "requested": "[0.4.15, )", - "resolved": "0.4.15", - "contentHash": "JxPHmjHQnTQNdppNKfyrvUZoVq/q83Q921zyZ01qqfySKqkTrZQRUfeCu746SSf0xeeTuqFdCTpGN3CTwz2XqQ==", + "requested": "[0.4.16, )", + "resolved": "0.4.16", + "contentHash": "CGj8Y99V+80TICiUoeHTiSCVpa9pkvSwDSHIQxRDfJ0y6f84MdeTdUvMMJqcsoLyPt+20yNJBZ/LYmIw+YWa0Q==", "dependencies": { - "Elastic.Transport": "0.4.15" + "Elastic.Transport": "0.4.16" } }, "FSharp.Core": {